XifengGuo / CapsNet-Pytorch

Pytorch implementation for NIPS2017 paper `Dynamic Routing Between Capsules`
MIT License
155 stars 36 forks source link

something about the loading model #5

Open airhandsome opened 5 years ago

airhandsome commented 5 years ago

when I have finished training the model. As your code shows, the model was save as pkl type. And when I load the load_state_dict(), the key could not compatible. like the following: RuntimeError: Error(s) in loading state_dict for CapsuleNet: Missing key(s) in state_dict: "conv1.bias", "conv1.weight", "primarycaps.conv2d.bias", "primarycaps.conv2d.weight", "digitcaps.weight", "decoder.0.bias", "decoder.0.weight", "decoder.2.bias", "decoder.2.weight", "decoder.4.bias", "decoder.4.weight". Unexpected key(s) in state_dict: "module.conv1.weight", "module.conv1.bias", "module.primarycaps.conv2d.weight", "module.primarycaps.conv2d.bias", "module.digitcaps.weight", "module.decoder.0.weight", "module.decoder.0.bias", "module.decoder.2.weight", "module.decoder.2.bias", "module.decoder.4.weight", "module.decoder.4.bias".