File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
pytorch_lightning/callbacks Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -302,12 +302,10 @@ def on_train_epoch_end(
302302 # as we advance one step at end of training, we use `global_step - 1` to avoid saving duplicates
303303 trainer .train_loop .global_step -= 1
304304 if (
305- self ._should_skip_saving_checkpoint (trainer ) or not self ._save_on_train_epoch_end
306- or self ._every_n_epochs < 1 or (trainer .current_epoch + 1 ) % self ._every_n_epochs ! = 0
305+ not self ._should_skip_saving_checkpoint (trainer ) and self ._save_on_train_epoch_end
306+ and self ._every_n_epochs > 0 and (trainer .current_epoch + 1 ) % self ._every_n_epochs = = 0
307307 ):
308- trainer .train_loop .global_step += 1
309- return
310- self .save_checkpoint (trainer )
308+ self .save_checkpoint (trainer )
311309 trainer .train_loop .global_step += 1
312310
313311 def on_validation_end (self , trainer : 'pl.Trainer' , pl_module : 'pl.LightningModule' ) -> None :
You can’t perform that action at this time.
0 commit comments