Skip to content

Commit

Permalink
close validation progress bar before updating training bar
Browse files Browse the repository at this point in the history
  • Loading branch information
awaelchli committed Sep 7, 2023
1 parent 4512265 commit 3ad5809
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lightning/pytorch/callbacks/progress/tqdm_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ def on_sanity_check_start(self, *_: Any) -> None:
self.train_progress_bar = Tqdm(disable=True) # dummy progress bar

def on_sanity_check_end(self, *_: Any) -> None:
self.train_progress_bar.close()
self.val_progress_bar.close()
self.train_progress_bar.close()

def on_train_start(self, *_: Any) -> None:
self.train_progress_bar = self.init_train_tqdm()
Expand Down Expand Up @@ -300,10 +300,10 @@ def on_validation_batch_end(
_update_n(self.val_progress_bar, n)

def on_validation_end(self, trainer: "pl.Trainer", pl_module: "pl.LightningModule") -> None:
if self._train_progress_bar is not None and trainer.state.fn == "fit":
self.train_progress_bar.set_postfix(self.get_metrics(trainer, pl_module))
self.val_progress_bar.close()
self.reset_dataloader_idx_tracker()
if self._train_progress_bar is not None and trainer.state.fn == "fit":
self.train_progress_bar.set_postfix(self.get_metrics(trainer, pl_module))

def on_test_start(self, trainer: "pl.Trainer", pl_module: "pl.LightningModule") -> None:
self.test_progress_bar = self.init_test_tqdm()
Expand Down

0 comments on commit 3ad5809

Please sign in to comment.