Skip to content

Commit

Permalink
Update model_checkpoint.py
Browse files Browse the repository at this point in the history
  • Loading branch information
ananthsub committed Mar 2, 2021
1 parent 0ec9949 commit 094eddb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pytorch_lightning/callbacks/model_checkpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,9 @@ def on_validation_end(self, trainer, pl_module):
"""
checkpoints can be saved at the end of the val loop
"""
epoch = trainer.current_epoch
skip = (
self._should_skip_saving_checkpoint(trainer) or self.every_n_epochs < 1
or (epoch + 1) % self.every_n_epochs != 0
or (trainer.current_epoch + 1) % self.every_n_epochs != 0
)
if skip:
return
Expand Down

0 comments on commit 094eddb

Please sign in to comment.