Fix EMA model training with lightning
Summary: Current implementation of d2go lightning default task fails when running a model training with EMA. The error is : ``` RuntimeError: Expected to have finished reduction in the prior iteration before starting a new one. This error indicates that your module has parameters that were not used in producing loss. ``` The error is due the fact the d2go lightning task create a copy of the ema model for evaluation that does not included in the training, which raise the error that there are unused params. This is solved by moving the copy creation to after training and to when evaluation starts. Reviewed By: kazhang Differential Revision: D33442690 fbshipit-source-id: e9e469e33811de0b4171a64293cc16a8157af08c
Showing
Please register or sign in to comment