mirror of
https://github.com/k2-fsa/icefall.git
synced 2025-08-09 10:02:22 +00:00
Update train.py (#1590)
This commit is contained in:
parent
ba5b2e854b
commit
ed6bc200e3
@ -966,7 +966,10 @@ def train_one_epoch(
|
||||
scaler.step(optimizer)
|
||||
scaler.update()
|
||||
optimizer.zero_grad()
|
||||
except: # noqa
|
||||
except Exception as e:
|
||||
logging.info(
|
||||
f"Caught exception: {e}."
|
||||
)
|
||||
save_bad_model()
|
||||
display_and_save_batch(batch, params=params, sp=sp)
|
||||
raise
|
||||
|
Loading…
x
Reference in New Issue
Block a user