From 2ae2bd2b4699dd3661274149c536bacaa2397b2b Mon Sep 17 00:00:00 2001 From: vguizilini Date: Wed, 8 Apr 2020 08:51:52 -0700 Subject: [PATCH] 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 Co-authored-by: Jirka Borovec --- pytorch_lightning/trainer/evaluation_loop.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pytorch_lightning/trainer/evaluation_loop.py b/pytorch_lightning/trainer/evaluation_loop.py index b55535784b..b10173ee63 100644 --- a/pytorch_lightning/trainer/evaluation_loop.py +++ b/pytorch_lightning/trainer/evaluation_loop.py @@ -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) - print('TEST RESULTS') - pprint(prog_bar_metrics) - print('-' * 100) + if test_mode and self.proc_rank == 0 and prog_bar_metrics: + print('-' * 80) + print('TEST RESULTS') + pprint(prog_bar_metrics) + print('-' * 80) # log metrics self.log_metrics(log_metrics, {})