未验证 提交 637bb9cd 编写于 作者: S ShawnXuan 提交者: GitHub

Merge pull request #111 from Oneflow-Inc/add_time_stamp

print time stamp
......@@ -157,12 +157,12 @@ class Metric(object):
if self.loss_key:
loss = outputs[self.loss_key].mean()
print(self.fmt.format(self.desc, epoch, step + 1, loss, top_1_accuracy,
top_k_accuracy, throughput))
top_k_accuracy, throughput), time.time())
if self.save_summary:
self.summary.scalar(self.desc+"_" + self.loss_key, loss, epoch, step)
else:
print(self.fmt.format(self.desc, epoch, step + 1, top_1_accuracy,
top_k_accuracy, throughput))
top_k_accuracy, throughput), time.time())
self._clear()
if self.save_summary:
......
......@@ -156,7 +156,7 @@ class Metric(object):
value = self.metric_dict[key] / self.num_samples
self.update_and_save(key, value, step, **kwargs)
print(', '.join(('{}: {}' if type(v) is int else '{}: {:.3f}').format(k, v) \
for k, v in self.metric_dict.items()))
for k, v in self.metric_dict.items()), time.time())
self._clear()
return callback
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册