File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
src/lightning/pytorch/callbacks/progress Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -357,6 +357,13 @@ def refresh(self) -> None:
357357 def on_train_start (self , trainer : "pl.Trainer" , pl_module : "pl.LightningModule" ) -> None :
358358 self ._init_progress (trainer )
359359
360+ # Initialize the training progress bar here because
361+ # `on_train_epoch_start` is not called when resuming from a mid-epoch restart
362+ total_batches = self .total_train_batches
363+ train_description = self ._get_train_description (trainer .current_epoch )
364+ assert self .progress is not None
365+ self .train_progress_bar_id = self ._add_task (total_batches , train_description )
366+
360367 @override
361368 def on_predict_start (self , trainer : "pl.Trainer" , pl_module : "pl.LightningModule" ) -> None :
362369 self ._init_progress (trainer )
You can’t perform that action at this time.
0 commit comments