Before calculating the validation_loss, set net.eval() and back to net.train() for training.
Also, note that the model checkpoint is saved at the following point, not at the end of the loop. So, ensure that the same checkpoint and data is used for fair evaluation.



 dpalbrecht:

if i % 2000 == 1999:


If these conditions are met, your loss values and predictions should match exactly.