mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-09 11:32:07 +08:00
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
This commit is contained in:
@@ -491,7 +491,8 @@ class Trainer(TrainerIOMixin,
|
||||
ref_model.on_sanity_check_start()
|
||||
if self.get_val_dataloaders() is not None and self.num_sanity_val_steps > 0:
|
||||
# init progress bars for validation sanity check
|
||||
pbar = tqdm.tqdm(desc='Validation sanity check', total=self.num_sanity_val_steps,
|
||||
pbar = tqdm.tqdm(desc='Validation sanity check',
|
||||
total=self.num_sanity_val_steps * len(self.get_val_dataloaders()),
|
||||
leave=False, position=2 * self.process_position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True, unit='batch')
|
||||
self.main_progress_bar = pbar
|
||||
|
||||
Reference in New Issue
Block a user