未验证 提交 29624f88 编写于 作者: E Edward Yang 提交者: GitHub

Fix the problem of trainer error when metrics is not of float type

上级 de38b6e3
......@@ -313,7 +313,7 @@ class Trainer(object):
print_msg += ' avg_loss={:.4f}'.format(avg_loss)
for metric, value in sum_metrics.items():
avg_metrics[metric] = value / num_samples
avg_metrics[metric] = float(value) / num_samples
print_msg += ' avg_{}={:.4f}'.format(metric, avg_metrics[metric])
logger.eval(print_msg)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册