diff --git a/pytorch_lightning/callbacks/model_checkpoint.py b/pytorch_lightning/callbacks/model_checkpoint.py index 89da66dedd2d5f..98566138fb0c30 100644 --- a/pytorch_lightning/callbacks/model_checkpoint.py +++ b/pytorch_lightning/callbacks/model_checkpoint.py @@ -162,8 +162,6 @@ def __init__( save_last: Optional[bool] = None, save_top_k: Optional[int] = None, save_weights_only: bool = False, - every_n_epochs: int = 1, - every_n_batches: int = -1, mode: str = "min", every_n_epochs: int = 1, every_n_batches: int = -1, diff --git a/tests/checkpointing/test_model_checkpoint.py b/tests/checkpointing/test_model_checkpoint.py index 0af2464469da1d..0dcdf368e30008 100644 --- a/tests/checkpointing/test_model_checkpoint.py +++ b/tests/checkpointing/test_model_checkpoint.py @@ -516,13 +516,9 @@ def test_invalid_every_n_epoch(tmpdir): def test_invalid_every_n_batches(tmpdir): """ Test that an exception is raised for every_n_batches = 0 or < -1. """ - with pytest.raises( - MisconfigurationException, match=r'Invalid value for every_n_batches=0*' - ): + with pytest.raises(MisconfigurationException, match=r'Invalid value for every_n_batches=0*'): ModelCheckpoint(dirpath=tmpdir, every_n_batches=0) - with pytest.raises( - MisconfigurationException, match=r'Invalid value for every_n_batches=-2*' - ): + with pytest.raises(MisconfigurationException, match=r'Invalid value for every_n_batches=-2*'): ModelCheckpoint(dirpath=tmpdir, every_n_batches=-2) # These should not fail