I don’t quite understand the issue as:



 codebat:

of the model at the end of training and at the start of the inference code, they are exactly equal.





 codebat:

Your suspicion is correct. It is giving different results on the same training data. To test that only I am running inference with train_dataloader.


doesn’t explain what is creating the different outputs.
If I understand your use case correctly you are comparing:

training iteration using a fixed input in model.eval()

vs. the exact same setup but this time in the “inference loop”?