Problem with load trained model

Hi all.
I tried many times until I dare ask a question here. Would appreciate help.
I tried to load a trained model to the local env, after I saved.
But, when I run to load, I got this issue:
AttributeError: 'Conv2d' object has no attribute 'padding_mode'

I tried updating the version, updating fast.ai, but to no avail.

After I failed locally, I tried to raise my trained weights to the same environment I had trained, but only to try and test whether it worked. And to my surprise I get the same error.

I add the code I try to load model only:

defaults.device = torch.device('cpu')
img = open_image('test-image.jpeg')
learn = load_learner('/notebooks/course-v3/nbs/dl1')
pred_class,pred_idx,outputs = learn.predict(img)
pred_class

An identical problem occurred when I tried to upload the model to render web server.

Please, any help.
Thanks.

This one’s hard to debug, it looks like it’s loading in a model it didn’t expect, but it’s hard to say more without seeing what you’re doing.

Could you post a minimal notebook that shows how the issue occurs? I.e. how did you save the model, and how are you loading it?

Thank you.
My problem solved by loading the .pth file like an Jeremy example, and now it’s looks good.

thanks.