CapsNet-pytorch icon indicating copy to clipboard operation
CapsNet-pytorch copied to clipboard

Visualization results

Open jisheng8 opened this issue 1 year ago • 0 comments

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".

jisheng8 avatar Nov 09 '23 07:11 jisheng8