提交 b50d4ef7 编写于 作者: W WuHaobo

polish for mixup

上级 a5df2be1
......@@ -385,19 +385,20 @@ def run(dataloader, exe, program, fetchs, epoch=0, mode='train'):
metric_list[i].update(m[0], len(batch[0]))
fetchs_str = ''.join([str(m.value) + ' '
for m in metric_list] + [batch_time.value])
if epoch != -1:
if mode == 'valid':
logger.info("{:s} step:{:<4d} {:s}s".format(mode, idx, fetchs_str))
else:
logger.info("epoch:{:<3d} {:s} step:{:<4d} {:s}s".format(
epoch, mode, idx, fetchs_str))
else:
logger.info("{:s} step:{:<4d} {:s}s".format(mode, idx, fetchs_str))
end_str = ''.join([str(m.mean) + ' '
for m in metric_list] + [batch_time.total])
if epoch != -1:
logger.info("END epoch:{:<3d} {:s} {:s}s".format(epoch, mode, end_str))
else:
if mode == 'valid':
logger.info("END {:s} {:s}s".format(mode, end_str))
else:
logger.info("END epoch:{:<3d} {:s} {:s}s".format(epoch, mode, end_str))
# save the best model
top1_acc = fetchs["top1"][1].avg
return top1_acc
if mode == 'valid':
top1_acc = fetchs["top1"][1].avg
return top1_acc
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册