Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Rohit Gupta <[email protected]>
  • Loading branch information
Borda and rohitgr7 authored Feb 24, 2021
1 parent dcb14bb commit 02bb04b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class ModelCheckpoint(Callback):
mode: one of {min, max}.
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.
For ``'val_acc'``, this should be ``'max'``, for ``'val_loss'`` this should be ``'min'``, etc.
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)``).
Expand All @@ -110,7 +110,7 @@ class ModelCheckpoint(Callback):
MisconfigurationException:
If ``save_top_k`` is neither ``None`` nor more than or equal to ``-1``,
if ``monitor`` is ``None`` and ``save_top_k`` is none of ``None``, ``-1``, and ``0``, or
if ``mode`` is none of ``"min"``, ``"max"``.
if ``mode`` is none of ``"min"`` or ``"max"``.
ValueError:
If ``trainer.save_checkpoint`` is ``None``.
Expand Down
2 changes: 1 addition & 1 deletion tests/trainer/test_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ def test_dp_output_reduce():


@pytest.mark.parametrize(
["save_top_k", "save_last", "expected_files"],
"save_top_k,save_last,expected_files",
[
pytest.param(-1, False, [f"epoch={i}.ckpt" for i in range(5)], id="CASE K=-1 (all)"),
pytest.param(1, False, {"epoch=4.ckpt"}, id="CASE K=1 (2.5, epoch 4)"),
Expand Down

0 comments on commit 02bb04b

Please sign in to comment.