mirror of
https://github.com/wassname/pytorch-lightning.git
synced 2026-09-12 12:40:20 +08:00
Make default tqdm dict overridable (#749)
* overridable tqdm_dict * Slim down default tqdm_metrics * gpu fix
This commit is contained in:
@@ -295,7 +295,7 @@ class TrainerEvaluationLoopMixin(ABC):
|
||||
desc = 'Testing' if test else 'Validating'
|
||||
pbar = tqdm(desc=desc, total=max_batches, leave=test, position=position,
|
||||
disable=not self.show_progress_bar, dynamic_ncols=True,
|
||||
unit='batch', file=sys.stdout)
|
||||
file=sys.stdout)
|
||||
setattr(self, f'{"test" if test else "val"}_progress_bar', pbar)
|
||||
|
||||
# run evaluation
|
||||
@@ -319,9 +319,8 @@ class TrainerEvaluationLoopMixin(ABC):
|
||||
model.on_post_performance_check()
|
||||
|
||||
# add model specific metrics
|
||||
tqdm_metrics = self.training_tqdm_dict
|
||||
if not test:
|
||||
self.main_progress_bar.set_postfix(**tqdm_metrics)
|
||||
self.main_progress_bar.set_postfix(**self.training_tqdm_dict)
|
||||
|
||||
# close progress bar
|
||||
if test:
|
||||
|
||||
Reference in New Issue
Block a user