You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running the net.py file, the model file. pth was obtained. However, the following error reasons occurred while running the visualization file. How to solve them:
Traceback (most recent call last):
File "result_visual.py", line 18, in
model.load_state_dict(torch.load(MODEL_PATH))
File "/remote-home/js/anaconda3/envs/capsnet2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1224, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CapsNetWithReconstruction:
Missing key(s) in state_dict:"capsnet.conv1.weight", "capsnet.conv1.bias", "capsnet.primaryCaps.conv.weight", "capsnet.primaryCaps.conv.bias", "capsnet.digitCaps.weights", "capsnet.digitCaps.routing_module.b", "reconstruction_net.fc1.weight", "reconstruction_net.fc1.bias", "reconstruction_net.fc2.weight", "reconstruction_net.fc2.bias", "reconstruction_net.fc3.weight", "reconstruction_net.fc3.bias".
Unexpected key(s) in state_dict:"conv1.weight", "conv1.bias", "primaryCaps.conv.weight", "primaryCaps.conv.bias", "digitCaps.weights", "digitCaps.routing_module.b".
The text was updated successfully, but these errors were encountered:
After running the net.py file, the model file. pth was obtained. However, the following error reasons occurred while running the visualization file. How to solve them:
Traceback (most recent call last):
File "result_visual.py", line 18, in
model.load_state_dict(torch.load(MODEL_PATH))
File "/remote-home/js/anaconda3/envs/capsnet2/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1224, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for CapsNetWithReconstruction:
Missing key(s) in state_dict:"capsnet.conv1.weight", "capsnet.conv1.bias", "capsnet.primaryCaps.conv.weight", "capsnet.primaryCaps.conv.bias", "capsnet.digitCaps.weights", "capsnet.digitCaps.routing_module.b", "reconstruction_net.fc1.weight", "reconstruction_net.fc1.bias", "reconstruction_net.fc2.weight", "reconstruction_net.fc2.bias", "reconstruction_net.fc3.weight", "reconstruction_net.fc3.bias".
Unexpected key(s) in state_dict:"conv1.weight", "conv1.bias", "primaryCaps.conv.weight", "primaryCaps.conv.bias", "digitCaps.weights", "digitCaps.routing_module.b".
The text was updated successfully, but these errors were encountered: