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 5, 2021
1 parent 725719b commit d91636d
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 @@ -210,8 +210,7 @@ def on_train_batch_end(self, trainer, pl_module, outputs, batch, batch_idx, data
if self._should_skip_saving_checkpoint(trainer):
return
step = trainer.global_step
skip_batch = self.every_n_batches < 1 or ((step + 1) % self.every_n_batches != 0)
log.warning(f"in on_train_batch_end at step {step}, every_n_batches={self.every_n_batches}, going to skip batch? {skip_batch}")
skip_batch = self.every_n_steps < 1 or ((step + 1) % self.every_n_steps != 0)
if skip_batch:
return
self.save_checkpoint(trainer, pl_module)
Expand Down

0 comments on commit d91636d

Please sign in to comment.