Skip to content

Commit

Permalink
defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthsub committed Feb 24, 2021
1 parent 2848bdc commit 34bcdc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
8 changes: 2 additions & 6 deletions tests/checkpointing/test_model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 34bcdc1

Please sign in to comment.