Commit 4d27208
Z User
fix(training): scaler.unscale_() called after step() on optim_d
scaler.update() was only called after optim_g.step(), which resets
the scaler's internal state. On the next iteration, optim_d tried
to call scaler.unscale_() on an already-updated scaler -> crash.
Fix: add scaler.update() right after scaler.step(optim_d) so each
optimizer properly completes its own scaler cycle before the other
one runs.1 parent d29cb66 commit 4d27208
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
762 | 762 | | |
763 | 763 | | |
764 | 764 | | |
| 765 | + | |
765 | 766 | | |
766 | 767 | | |
767 | 768 | | |
| |||
0 commit comments