提交 d5faea96 编写于 作者: Z zhangxuefei

fix the bug that tb_paddle writes data in different phases

上级 30dabb01
......@@ -460,14 +460,14 @@ class BasicTask(object):
self.tb_writer.add_scalar(
tag="Loss_{}".format(self.phase),
scalar_value=eval_loss,
global_step=self.current_step)
global_step=self._envs['train'].current_step)
log_scores = ""
for metric in eval_scores:
self.tb_writer.add_scalar(
tag="{}_{}".format(metric, self.phase),
scalar_value=eval_scores[metric],
global_step=self.current_step)
global_step=self._envs['train'].current_step)
log_scores += "%s=%.5f " % (metric, eval_scores[metric])
logger.info(
......@@ -500,13 +500,13 @@ class BasicTask(object):
self.tb_writer.add_scalar(
tag="Loss_{}".format(self.phase),
scalar_value=avg_loss,
global_step=self.current_step)
global_step=self._envs['train'].current_step)
log_scores = ""
for metric in scores:
self.tb_writer.add_scalar(
tag="{}_{}".format(metric, self.phase),
scalar_value=scores[metric],
global_step=self.current_step)
global_step=self._envs['train'].current_step)
log_scores += "%s=%.5f " % (metric, scores[metric])
logger.info("step %d / %d: loss=%.5f %s[step/sec: %.2f]" %
(self.current_step, self.max_train_steps, avg_loss,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册