Manually setting self.train in training_step #20113
Unanswered
pengbao7598
asked this question in
Lightning Trainer API: Trainer, LightningModule, LightningDataModule
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I changed my code from normal training to Lightning. However, I cannot get the same results. I carefully checked the random seed and batch index.
If I don't manually call self.train() in the training_step, I get different predictions for the same model and the same batch sequence. However, if I call self.train() in the training_step, I get the same prediction with my previous codes.
I think this is weird. It should produce the same results whether I manually call self.train() or not, right?
Beta Was this translation helpful? Give feedback.
All reactions