Remove call to deprecated fit_loop (#8873)

This commit is contained in:
christopherfish 2021-08-13 09:06:36 +01:00 committed by GitHub
parent 4b6aaeeae3
commit 0749c1e7d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -332,9 +332,9 @@ class ModelCheckpoint(Callback):
rank_zero_info("Saving latest checkpoint...")
# as we advance one step at end of training, we use `global_step - 1` to avoid saving duplicates
monitor_candidates = self._monitor_candidates(trainer, trainer.current_epoch, trainer.global_step - 1)
trainer.train_loop.global_step -= 1
trainer.fit_loop.global_step -= 1
self._save_last_checkpoint(trainer, monitor_candidates)
trainer.train_loop.global_step += 1
trainer.fit_loop.global_step += 1
def on_save_checkpoint(
self, trainer: "pl.Trainer", pl_module: "pl.LightningModule", checkpoint: Dict[str, Any]