Commit d3d70f7
committed
Fix opt_state type mismatch when restoring checkpoints with Adam/LAMB optimizers
When using Adam or LAMB optimizers with reset_if_nan=True, the opt_state
loaded from checkpoint is a list but should be a tuple. This causes
jax.lax.cond at train.py:315 to fail during training. Convert opt_state_ckpt
to tuple when restoring from checkpoint to ensure type consistency.1 parent fa69b4c commit d3d70f7
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
883 | 883 | | |
884 | 884 | | |
885 | 885 | | |
886 | | - | |
| 886 | + | |
| 887 | + | |
887 | 888 | | |
888 | 889 | | |
889 | 890 | | |
| |||
0 commit comments