Skip to content

LightingModel.save_checkpoint() #21280

@Karesto

Description

@Karesto

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    checkpointingRelated to checkpointingfeatureIs an improvement or enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions