From f42ddb24b766b18831a4d290ba48adb90ea430c6 Mon Sep 17 00:00:00 2001 From: Dinghao Zhou Date: Fri, 26 Apr 2024 15:39:11 +0800 Subject: [PATCH] [wenet/utils/train_utils.py] fix log (#2504) * [wenet/utils/train_utils.py] fix log * Update train_utils.py --- wenet/utils/train_utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wenet/utils/train_utils.py b/wenet/utils/train_utils.py index fee435dc58..c16e085ea0 100644 --- a/wenet/utils/train_utils.py +++ b/wenet/utils/train_utils.py @@ -790,8 +790,8 @@ def log_per_step(writer, info_dict, timer: Optional[StepTimer] = None): steps_per_second = timer.steps_per_second(timer_step) log_str += 'steps/sec {:.1f}| '.format(steps_per_second) log_str += 'Batch {}/{} loss {:.6f} '.format( - epoch, - batch_idx + 1 if 'save_interval' not in info_dict else step + 1, + epoch, batch_idx + 1 if 'save_interval' not in info_dict else + (step + 1) * accum_grad, tensor_to_scalar(loss_dict['loss']) * accum_grad) for name, value in loss_dict.items(): if name != 'loss' and value is not None: