mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-12-11 06:55:27 +00:00
Add logging
This commit is contained in:
parent
fd3f21f84d
commit
2e93e5d3b7
@ -852,6 +852,10 @@ def train_one_epoch(
|
||||
cur_grad_scale = scaler._scale.item()
|
||||
if cur_grad_scale < 1.0:
|
||||
scaler.update(cur_grad_scale * 2.0)
|
||||
if cur_grad_scale < 0.01:
|
||||
logging.warn("Grad scale is small: {cur_grad_scale}")
|
||||
if cur_grad_scale < 1.0e-05:
|
||||
raise RuntimeError("grad_scale is too small, exiting: {cur_grad_scale}")
|
||||
|
||||
if batch_idx % params.log_interval == 0:
|
||||
cur_lr = scheduler.get_last_lr()[0]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user