From 9bbca402ff71c43656d977bb48ce0e30a12b08c6 Mon Sep 17 00:00:00 2001 From: Jaime Ferrando Huertas Date: Thu, 8 Jul 2021 01:15:21 +0200 Subject: [PATCH] Add auto_insert_metric_name to ModelCheckpoint docstring. (#8310) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Carlos MocholĂ­ --- pytorch_lightning/callbacks/model_checkpoint.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index 8a2de80c5b..46778547ac 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -98,6 +98,10 @@ class ModelCheckpoint(Callback): If ``save_top_k != 0``, the decision to overwrite the current save file is made based on either the maximization or the minimization of the monitored quantity. For ``'val_acc'``, this should be ``'max'``, for ``'val_loss'`` this should be ``'min'``, etc. + auto_insert_metric_name: When ``True``, the checkpoints filenames will contain the metric name. + For example, ``filename='checkpoint_{epoch:02d}-{acc:02d}`` with epoch 1 and acc 80 will resolve to + ``checkpoint_epoch=01-acc=80.ckp``. Is useful to set it to ``False`` when metric names contain ``/`` + as this will result in extra folders. save_weights_only: if ``True``, then only the model's weights will be saved (``model.save_weights(filepath)``), else the full model is saved (``model.save(filepath)``).