Reproducing predictions in fastai v1

It seems that my predictions get worse after loading a model compared to predicting directly after training (this could be variance though)

Assuming I have the same databunch object, is it enough to:

  • create the same learner
  • load weights
  • call learn.model.eval()

and then predict?

And I’m a little confused by the fact that:
returns the layers of the model, it should still set the model in eval model mode with just that line, right?

pytorch function model.eval() returns the model, so that’s why you see something. You can make it disappear with a ; at the end of your line.
Be careful to load the same validation set if you’re using it to validate.

1 Like


Yes, I now save and load the validation indices to make sure I’m using the same split

Merry Christmas and thank you for everything you do around this project!