Lightning-AI / Lightning-AI/pytorch-lightning
LightingModel.save_checkpoint()
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 31.4k
- Forks
- 3.8k
- Avg merge
- 6d 7h
- Merged PRs (30d)
- 6
Description
### Description & Motivation
Allow Lightning model to save a checkpoint, that you can load with load_from_checkpoint.
### Pitch
I have encountered this issue several times, as I try to switch to Lightning, it is not simple to take old checkpoints from native pytorch and run them on the new code (for testing/comparison purposes for examples)
I tried to make a model, then load LightningModel.Model with the weights, but then if I want to save it, I need to run a full mock training which isn't handy or practical.
### Alternatives
You could have a simple attach method on the trainer to attach a model without having to use Fit/Test/predict etc... and requiring arguments. Which would be a good alternative.
### Additional context
_No response_
cc @lantiga @borda
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
Start by reviewing the existing load_from_checkpoint path and how a Lightning model is currently constructed from native PyTorch weights. Define the checkpoint-saving entry point from the issue's requested behavior; done means a model can save a checkpoint that load_from_checkpoint can load without running mock training.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100