I am getting different results for implementations in lightning and in vanilla pytorch, which to my understanding need to be equivalent, and I’d like to find out why. I have taken the code in From Pytroch to Pytorch Lightning, specifically the code under “full training loop for pytorch” and “full training loop for lightning”, and introduced the following changes:
- for both: added pl.seed_everything(42) right after the imports.
- for lightning: disabled sanity check in the trainer.
- for lightning: replaced self.forward calls with self.
However, both codes don’t operate identically. Does anybody know why?