Mismatch of predict_array results for loaded from file and in-memory model


#1

Hi!

I am experiencing the following issue:

Prediction on a single picture with learn.predict_array(im[None]) gives totally different probabilities
depending on whether I do prediction using in-memory model or model loaded from a file (the same model previously saved with fastai method learn.save).

It seems to me that model is not correctly saved to the file.
Did anyone have similar issue? How to fix it?

Below code that I’m using:

trn_tfms, val_tfms = tfms_from_model(arch,sz,aug_tfms=transforms_side_on, max_zoom=1.1)
image = open_image(image_path)
_learn.precompute=False
log_pred = learn.predict_array(im[None])
prob =np.exp(log_pred)

Looking forward to your answer.

Thanks