Skip to content

Commit 9bbca40

Browse files
jiwidicarmocca
andauthored
Add auto_insert_metric_name to ModelCheckpoint docstring. (#8310)
Co-authored-by: Carlos Mocholí <[email protected]>
1 parent b6108f1 commit 9bbca40

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pytorch_lightning/callbacks/model_checkpoint.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ class ModelCheckpoint(Callback):
9898
If ``save_top_k != 0``, the decision to overwrite the current save file is made
9999
based on either the maximization or the minimization of the monitored quantity.
100100
For ``'val_acc'``, this should be ``'max'``, for ``'val_loss'`` this should be ``'min'``, etc.
101+
auto_insert_metric_name: When ``True``, the checkpoints filenames will contain the metric name.
102+
For example, ``filename='checkpoint_{epoch:02d}-{acc:02d}`` with epoch 1 and acc 80 will resolve to
103+
``checkpoint_epoch=01-acc=80.ckp``. Is useful to set it to ``False`` when metric names contain ``/``
104+
as this will result in extra folders.
101105
save_weights_only: if ``True``, then only the model's weights will be
102106
saved (``model.save_weights(filepath)``), else the full model
103107
is saved (``model.save(filepath)``).

0 commit comments

Comments
 (0)