fix docs on saving checkpoints manually (#1373)

This commit is contained in:
Jeremy Jordan 2020-04-05 11:10:44 -04:00 committed by GitHub
parent b18accc64c
commit 38c56081ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -74,12 +74,14 @@ The Lightning checkpoint also saves the hparams (hyperparams) passed into the Li
Manual saving Manual saving
^^^^^^^^^^^^^ ^^^^^^^^^^^^^
You can manually save checkpoints and restore your model from the checkpointed state.
To save your own checkpoint call:
.. code-block:: python .. code-block:: python
model.save_checkpoint(PATH) model = MyModel(hparams)
trainer.fit(model)
trainer.save_checkpoint("example.ckpt")
new_model = MyModel.load_from_checkpoint(checkpoint_path="example.ckpt")
Checkpoint Loading Checkpoint Loading
------------------ ------------------