Skip to content

Commit

Permalink
[wenet]fix the step_xx.yaml grad_norm issue (#2288)
Browse files Browse the repository at this point in the history
correct: 
       grad_norm: 28.40692710876465
error: 
       grad_norm: !!python/object/apply:torch._utils._rebuild_tensor_v2...
  • Loading branch information
starhaox authored Jan 9, 2024
1 parent 8ab5354 commit 4fa03fe
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions wenet/utils/train_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@ def update_parameter_and_lr(model, optimizer, scheduler, scaler, info_dict):
optimizer.step()
optimizer.zero_grad()
scheduler.step()
grad_norm = grad_norm.item()

info_dict["lr"] = optimizer.param_groups[0]['lr']
info_dict["grad_norm"] = grad_norm
Expand Down

0 comments on commit 4fa03fe

Please sign in to comment.