lightly-ai / lightly-ai/lightly
ImageNet benchmark runs can't cleanly resume: no last.ckpt + timestamped run dirs
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 367
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 5
Description
`--ckpt-path` already flows into `trainer.fit(ckpt_path=...)` (`benchmarks/imagenet/resnet50/main.py:323`, `benchmarks/imagenet/vitb16/main.py:269`), so Lightning restores epoch, optimizer and scheduler state. Two gaps stop it being a clean resume.
**1. No explicit `ModelCheckpoint`.** The `pretrain()` callback lists (`resnet50/main.py:306`, `vitb16/main.py:252`) rely on Lightning's implicit epoch-end checkpoint. No `last.ckpt`, no mid-epoch save, no retention control for 100-epoch runs.
**2. Every launch stamps a fresh run dir** with `datetime.now()` (`resnet50/main.py:122`, `vitb16/main.py:103`). A resume logs to a new folder and there is no discovery of the prior checkpoint, so you hand-locate the `.ckpt` path.
**Scope** (benchmark-only, both `main.py`):
- [ ] Add `ModelCheckpoint(save_last=True, ...)` to both `pretrain()` callback lists.
- [ ] Add `--resume` that resolves the newest run dir + its `last.ckpt` and reuses that dir instead of stamping a new one.
- [ ] Pass the resolved path to `ckpt_path`.
- [ ] Document the flag in `benchmarks/imagenet/README.md`.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read benchmarks/imagenet/resnet50/main.py and vitb16/main.py around pretrain(), the callback lists, and the timestamped run-directory setup. Trace how --ckpt-path reaches trainer.fit, then implement and verify --resume uses the newest run directory and last.ckpt for both benchmarks. Update benchmarks/imagenet/README.md to document the flag and expected resume behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100