I didn’t look into your code but a major difference between model.evaluate() and model() is that if you don’t run model(..., training=False) (where ... refers to the inputs) then the layers are not going to run in inference mode which is not ideal for layers like Dropout, BatchNorm, etc.