Error loading weights; "11.weight"


#1

I try to load the .h5 of a pretrained model like this:
learn.load('name_of_h5')

Any idea for this?



File “/anaconda3/lib/python3.6/site-packages/torch/nn/modules/module.py”, line 522, in load_state_dict
.format(name))

KeyError: ‘unexpected key “11.weight” in state_dict’


#2

The error was caused by mixing different clones of FastAI. It was solved by using explicitly the same clone for training, saving/loading weights and testing purposes.