Skip to content

Commit e295c9c

Browse files
committed
fix: calling update_lr_schedulers after on_train_batch_end hook
fix issue: #7637
1 parent 7e2f7e9 commit e295c9c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pytorch_lightning/trainer/training_loop.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,9 @@ def run_training_epoch(self):
494494
if batch_output.signal == -1:
495495
break
496496

497+
# update LR schedulers
498+
self.update_lr_schedulers('step')
499+
497500
# hook
498501
# TODO: add outputs to batches
499502
self.on_train_batch_end(
@@ -523,8 +526,6 @@ def run_training_epoch(self):
523526
# -----------------------------------------
524527
self.save_loggers_on_train_batch_end()
525528

526-
# update LR schedulers
527-
self.update_lr_schedulers('step')
528529
self.trainer.checkpoint_connector.has_trained = True
529530

530531
self.total_batch_idx += 1

0 commit comments

Comments
 (0)