Skip to content

Commit

Permalink
Update train_utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Mddct authored Apr 26, 2024
1 parent 1d68d5c commit 9be4fec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions wenet/utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ def log_per_step(writer, info_dict, timer: Optional[StepTimer] = None):
return

# TRAIN & CV, Shell log (stdout)
if (step + 1) % log_interval == 0:
if (batch_idx + 1) % log_interval == 0:
log_str = '{} | '.format(tag)
if timer is not None:
timer_step = step
Expand All @@ -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:
Expand Down

0 comments on commit 9be4fec

Please sign in to comment.