Print test results only if prog_bar_metrics is not empty (#1411)

* Print test results only if prog_bar_metrics is not empty

* Update evaluation_loop.py

Co-authored-by: vitor-guizilini <vitor.guizilini@tri.global>
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
This commit is contained in:
vguizilini 2020-04-08 08:51:52 -07:00 committed by GitHub
parent 7d0c2c7db8
commit 2ae2bd2b46
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 6 deletions

View File

@ -377,12 +377,11 @@ class TrainerEvaluationLoopMixin(ABC):
self.add_tqdm_metrics(prog_bar_metrics)
# log results of test
if test_mode:
if self.proc_rank == 0:
print('-' * 100)
if test_mode and self.proc_rank == 0 and prog_bar_metrics:
print('-' * 80)
print('TEST RESULTS')
pprint(prog_bar_metrics)
print('-' * 100)
print('-' * 80)
# log metrics
self.log_metrics(log_metrics, {})