提交 ff042b92 编写于 作者: C chenzomi

unroll print loss

上级 412e4580
...@@ -67,7 +67,6 @@ class LossMonitor(Callback): ...@@ -67,7 +67,6 @@ class LossMonitor(Callback):
def step_end(self, run_context): def step_end(self, run_context):
cb_params = run_context.original_args() cb_params = run_context.original_args()
step_mseconds = (time.time() - self.step_time) * 1000
step_loss = cb_params.net_outputs step_loss = cb_params.net_outputs
if isinstance(step_loss, (tuple, list)) and isinstance(step_loss[0], Tensor): if isinstance(step_loss, (tuple, list)) and isinstance(step_loss[0], Tensor):
...@@ -85,9 +84,6 @@ class LossMonitor(Callback): ...@@ -85,9 +84,6 @@ class LossMonitor(Callback):
cur_step_in_epoch, cb_params.batch_num)) cur_step_in_epoch, cb_params.batch_num))
if self._per_print_times != 0 and cb_params.cur_step_num % self._per_print_times == 0: if self._per_print_times != 0 and cb_params.cur_step_num % self._per_print_times == 0:
print("Epoch: [{:3d}/{:3d}], step: [{:5d}/{:5d}], " print("epoch: {} step {}, loss is {}".format(cb_params.cur_epoch_num,
"loss: [{:5.4f}/{:5.4f}], time: [{:5.4f}]".format( cur_step_in_epoch,
cb_params.cur_epoch_num, cb_params.epoch_num, step_loss), flush=True)
cur_step_in_epoch, int(cb_params.batch_num),
step_loss, np.mean(self.losses),
step_mseconds), flush=True)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册