Skip to content

Commit cc65f39

Browse files
YehCFwilliamFalcon
authored andcommitted
Fix number of total steps shown in progress bar during sanity validation check when number of validation dataloaders >= 2 (#597)
* type: debug Calculate the adequate number of steps to run during sanity_check. This fixes the bug when there are two or more validation dataloaders. - Before: total=self.num_sanity_val_steps - After: total=self.num_sanity_val_steps*len(self.get_val_dataloaders()) * type: refactor Put total=... in the next line * type: refactor run flake8
1 parent 0489e31 commit cc65f39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pytorch_lightning/trainer/trainer.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,8 @@ def run_pretrain_routine(self, model):
491491
ref_model.on_sanity_check_start()
492492
if self.get_val_dataloaders() is not None and self.num_sanity_val_steps > 0:
493493
# init progress bars for validation sanity check
494-
pbar = tqdm.tqdm(desc='Validation sanity check', total=self.num_sanity_val_steps,
494+
pbar = tqdm.tqdm(desc='Validation sanity check',
495+
total=self.num_sanity_val_steps * len(self.get_val_dataloaders()),
495496
leave=False, position=2 * self.process_position,
496497
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch')
497498
self.main_progress_bar = pbar

0 commit comments

Comments
 (0)