From bce8078b63c272dbcaa22a7ef639be54a2b2d32a Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Tue, 14 Sep 2021 11:16:07 +0100 Subject: [PATCH 1/2] Update log message. --- references/classification/train.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/references/classification/train.py b/references/classification/train.py index 89eae31c2cd..3dc20a1588c 100644 --- a/references/classification/train.py +++ b/references/classification/train.py @@ -71,8 +71,8 @@ def evaluate(model, criterion, data_loader, device, print_freq=100, log_suffix=' # gather the stats from all processes metric_logger.synchronize_between_processes() - print(' * Acc@1 {top1.global_avg:.3f} Acc@5 {top5.global_avg:.3f}' - .format(top1=metric_logger.acc1, top5=metric_logger.acc5)) + print('{header} Acc@1 {top1.global_avg:.3f} Acc@5 {top5.global_avg:.3f}' + .format(header=header, top1=metric_logger.acc1, top5=metric_logger.acc5)) return metric_logger.acc1.global_avg From ae33ee617d2f25d2a7a6b5df89b5f84d5cfe99d9 Mon Sep 17 00:00:00 2001 From: Vasilis Vryniotis Date: Tue, 14 Sep 2021 11:36:47 +0100 Subject: [PATCH 2/2] Update fstring. --- references/classification/train.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/references/classification/train.py b/references/classification/train.py index 3dc20a1588c..7b66299ee36 100644 --- a/references/classification/train.py +++ b/references/classification/train.py @@ -71,8 +71,7 @@ def evaluate(model, criterion, data_loader, device, print_freq=100, log_suffix=' # gather the stats from all processes metric_logger.synchronize_between_processes() - print('{header} Acc@1 {top1.global_avg:.3f} Acc@5 {top5.global_avg:.3f}' - .format(header=header, top1=metric_logger.acc1, top5=metric_logger.acc5)) + print(f'{header} Acc@1 {metric_logger.acc1.global_avg:.3f} Acc@5 {metric_logger.acc5.global_avg:.3f}') return metric_logger.acc1.global_avg