Skip to content

Commit 2ae2bd2

Browse files
VitorGuiziliniVitorGuizilini-TRIBorda
authored
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 <[email protected]> Co-authored-by: Jirka Borovec <[email protected]>
1 parent 7d0c2c7 commit 2ae2bd2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pytorch_lightning/trainer/evaluation_loop.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,12 +377,11 @@ def run_evaluation(self, test_mode: bool = False):
377377
self.add_tqdm_metrics(prog_bar_metrics)
378378

379379
# log results of test
380-
if test_mode:
381-
if self.proc_rank == 0:
382-
print('-' * 100)
383-
print('TEST RESULTS')
384-
pprint(prog_bar_metrics)
385-
print('-' * 100)
380+
if test_mode and self.proc_rank == 0 and prog_bar_metrics:
381+
print('-' * 80)
382+
print('TEST RESULTS')
383+
pprint(prog_bar_metrics)
384+
print('-' * 80)
386385

387386
# log metrics
388387
self.log_metrics(log_metrics, {})

0 commit comments

Comments
 (0)