Oliver:

I thought .eval() just makes sure, dropout, batch norm, etc are all in evaluation mode, so I don’t see how it would affect it other than I misunderstood what .eval() does.


Yes, your assumption is right and calling model.eval() will set all modules into evaluation mode. E.g. batchnorm layers will use their running stats to normalize the input activations instead of the current batch stats. Depending on how well these running stats were fit to your dataset (and assuming they can even converge towards the “dataset mean and var”) this approach could work well or fail (as is seen in other posts here).