U-Net weight reloading destroys predictions

I’m training a U-Net with a resnet34 backbone as in Lesson 14 with a custom loss function. Training gives decent results (left column satellite image, middle prediction, right ground truth).

I then recreate the exact same model and dataset in a new notebook to make predictions, load the weights I just saved and predict on the same validation images and I get this:

Is there any reason why reloading the weights into the model shouldn’t work?

1 Like

oh i see the problem now, maybe make sure model is in eval mode by doing model.eval().

2 Likes

Is that your dropout in action?

Try explicitly setting the model to eval before predicting.

2 Likes

Argh! Thanks both of you. That was obviously the problem.

1 Like