From 95f90df0a357dd215851e54e3ffc12f3ec2b415c Mon Sep 17 00:00:00 2001 From: gca Date: Tue, 23 Feb 2021 12:17:21 -0300 Subject: [PATCH 1/2] Updated model_checkpoint documentation Signed-off-by: gca --- pytorch_lightning/callbacks/model_checkpoint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index 413e96a39afcd..b3aa97c776b0a 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -38,7 +38,10 @@ class ModelCheckpoint(Callback): r""" - Save the model after every epoch by monitoring a quantity. + Save the model after every epoch by monitoring a quantity. Every metric logged with + :meth:`~pytorch_lightning.core.lightning.log` or :meth:`~pytorch_lightning.core.lightning.log_dict` in + LightningModule is a candidate for the monitor key. For more information, see + :ref:`common/weights_loading:Checkpoint saving`. After training finishes, use :attr:`best_model_path` to retrieve the path to the best checkpoint file and :attr:`best_model_score` to retrieve its score. From 046cef04a3a3ae6443118c0dc0cb1da524cfe63b Mon Sep 17 00:00:00 2001 From: gca Date: Mon, 26 Apr 2021 12:55:35 -0300 Subject: [PATCH 2/2] Added recommended changes from #6873 Signed-off-by: gca --- pytorch_lightning/callbacks/model_checkpoint.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index 59e93be82ceac..1c21bd55cc988 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -41,10 +41,10 @@ class ModelCheckpoint(Callback): r""" - Save the model after every epoch by monitoring a quantity. Every metric logged with + Save the model periodically by monitoring a quantity. Every metric logged with :meth:`~pytorch_lightning.core.lightning.log` or :meth:`~pytorch_lightning.core.lightning.log_dict` in LightningModule is a candidate for the monitor key. For more information, see - :ref:`common/weights_loading:Checkpoint saving`. + :ref:`weights_loading`. After training finishes, use :attr:`best_model_path` to retrieve the path to the best checkpoint file and :attr:`best_model_score` to retrieve its score.