Update Checkpointing.md (#83)

* Update Checkpointing.md

Modified import for ModelCheckpoint.

* Update Checkpointing.md
This commit is contained in:
Lorenzo Fabbri
2019-08-09 15:02:36 -04:00
committed by William Falcon
parent dd0db4aba2
commit 09d4475cc7
+3 -3
View File
@@ -1,11 +1,11 @@
Lightning can automate saving and loading checkpoints. i Lightning can automate saving and loading checkpoints.
--- ---
### Model saving ### Model saving
To enable checkpointing, define the checkpoint callback and give it to the trainer. To enable checkpointing, define the checkpoint callback and give it to the trainer.
``` {.python} ``` {.python}
from pytorch_lightning.utils.pt_callbacks import ModelCheckpoint from pytorch_lightning.callbacks import ModelCheckpoint
checkpoint_callback = ModelCheckpoint( checkpoint_callback = ModelCheckpoint(
filepath='/path/to/store/weights.ckpt', 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 # uses the model you passed into trainer
model.load_state_dict(checkpoint['state_dict']) model.load_state_dict(checkpoint['state_dict'])
``` ```