Learn.load - RuntimeError: Error(s) in loading state_dict for Sequential

I built a model that I saved with learn.save()

Now I would like to load it, to check the accuracy on the test set, but when I run the following:
learn = cnn_learner(test_data, models.resnet50, metrics=accuracy)
learn.load(‘my own path’)

I get the following error:

RuntimeError: Error(s) in loading state_dict for Sequential:
Unexpected key(s) in state_dict: “1.9.weight”, “1.9.bias”, “1.9.running_mean”, “1.9.running_var”, “1.9.num_batches_tracked”.

I am using the fastai version 1.0.57

Does anybody have any suggestion about how to solve it?

I solved this just by restarting the server

1 Like