From aa8e3c1183feaae28c00f9e8f58bbe767c2d01be Mon Sep 17 00:00:00 2001 From: Tingquan Gao Date: Wed, 30 Dec 2020 17:36:56 +0800 Subject: [PATCH] Fix the mertirc_list when \'use_mix==True\' (#529) --- tools/static/program.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/static/program.py b/tools/static/program.py index c072622b..2f066e9c 100644 --- a/tools/static/program.py +++ b/tools/static/program.py @@ -503,8 +503,10 @@ def run(dataloader, ] topk_name = 'top{}'.format(config.topk) metric_list.insert(0, ("loss", fetchs["loss"][1])) - metric_list.insert(0, (topk_name, fetchs[topk_name][1])) - metric_list.insert(0, ("top1", fetchs["top1"][1])) + use_mix = config.get("use_mix", False) and mode == "train" + if not use_mix: + metric_list.insert(0, (topk_name, fetchs[topk_name][1])) + metric_list.insert(0, ("top1", fetchs["top1"][1])) metric_list = OrderedDict(metric_list) -- GitLab