Update Checkpointing.md (#83)

* Update Checkpointing.md

Modified import for ModelCheckpoint.

* Update Checkpointing.md
This commit is contained in:
Lorenzo Fabbri 2019-08-09 21:02:36 +02:00 committed by William Falcon
parent dd0db4aba2
commit 09d4475cc7
1 changed files with 3 additions and 3 deletions

View File

@ -1,11 +1,11 @@
Lightning can automate saving and loading checkpoints.
i Lightning can automate saving and loading checkpoints.
---
### Model saving
To enable checkpointing, define the checkpoint callback and give it to the trainer.
``` {.python}
from pytorch_lightning.utils.pt_callbacks import ModelCheckpoint
from pytorch_lightning.callbacks import ModelCheckpoint
checkpoint_callback = ModelCheckpoint(
filepath='/path/to/store/weights.ckpt',
@ -65,4 +65,4 @@ for scheduler, lrs_state in zip(self.lr_schedulers, lr_schedulers):
# uses the model you passed into trainer
model.load_state_dict(checkpoint['state_dict'])
```
```