Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Help wanted!] pretrained model mismatch #137

Open
l9761116 opened this issue May 22, 2022 · 2 comments
Open

[Help wanted!] pretrained model mismatch #137

l9761116 opened this issue May 22, 2022 · 2 comments

Comments

@l9761116
Copy link

l9761116 commented May 22, 2022

File "demo_folder.py", line 86, in main
my_model = my_model.load_state_dict(torch.load(model_load_path))
File "/home/liuwanzhen2/anaconda3/envs/cydr/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1407, in load_state_dict
self.class.name, "\n\t".join(error_msgs)))
RuntimeError: Error(s) in loading state_dict for cylinder_asym:
size mismatch for cylinder_3d_spconv_seg.downCntx.conv1.weight: copying a param with shape torch.Size([1, 3, 3, 16, 32]) from checkpoint, the shape in current model is torch.Size([32, 1, 3, 3, 16]).
size mismatch for cylinder_3d_spconv_seg.downCntx.conv1_2.weight: copying a param with shape torch.Size([3, 1, 3, 32, 32]) from checkpoint, the shape in current model is torch.Size([32, 3, 1, 3, 32]).
size mismatch for cylinder_3d_spconv_seg.downCntx.conv2.weight: copying a param with shape torch.Size([3, 1, 3, 16, 32]) from checkpoint, the shape in current model is torch.Size([32, 3, 1, 3, 16]).
size mismatch for cylinder_3d_spconv_seg.downCntx.conv3.weight: copying a param with shape torch.Size([1, 3, 3, 32, 32]) from checkpoint, the shape in current model is torch.Size([32, 1, 3, 3, 32]).
size mismatch for cylinder_3d_spconv_seg.resBlock2.conv1.weight: copying a param with shape torch.Size([3, 1, 3, 32, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 1, 3, 32]).
size mismatch for cylinder_3d_spconv_seg.resBlock2.conv1_2.weight: copying a param with shape torch.Size([1, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.resBlock2.conv2.weight: copying a param with shape torch.Size([1, 3, 3, 32, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3, 32]).
size mismatch for cylinder_3d_spconv_seg.resBlock2.conv3.weight: copying a param with shape torch.Size([3, 1, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 1, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.resBlock2.pool.weight: copying a param with shape torch.Size([3, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.resBlock3.conv1.weight: copying a param with shape torch.Size([3, 1, 3, 64, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 1, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.resBlock3.conv1_2.weight: copying a param with shape torch.Size([1, 3, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.resBlock3.conv2.weight: copying a param with shape torch.Size([1, 3, 3, 64, 128]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.resBlock3.conv3.weight: copying a param with shape torch.Size([3, 1, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 1, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.resBlock3.pool.weight: copying a param with shape torch.Size([3, 3, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.resBlock4.conv1.weight: copying a param with shape torch.Size([3, 1, 3, 128, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 1, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.resBlock4.conv1_2.weight: copying a param with shape torch.Size([1, 3, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.resBlock4.conv2.weight: copying a param with shape torch.Size([1, 3, 3, 128, 256]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.resBlock4.conv3.weight: copying a param with shape torch.Size([3, 1, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 1, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.resBlock4.pool.weight: copying a param with shape torch.Size([3, 3, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.resBlock5.conv1.weight: copying a param with shape torch.Size([3, 1, 3, 256, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 1, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.resBlock5.conv1_2.weight: copying a param with shape torch.Size([1, 3, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.resBlock5.conv2.weight: copying a param with shape torch.Size([1, 3, 3, 256, 512]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.resBlock5.conv3.weight: copying a param with shape torch.Size([3, 1, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 1, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.resBlock5.pool.weight: copying a param with shape torch.Size([3, 3, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock0.trans_dilao.weight: copying a param with shape torch.Size([3, 3, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock0.conv1.weight: copying a param with shape torch.Size([1, 3, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 1, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock0.conv2.weight: copying a param with shape torch.Size([3, 1, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 1, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock0.conv3.weight: copying a param with shape torch.Size([3, 3, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock0.up_subm.weight: copying a param with shape torch.Size([3, 3, 3, 512, 512]) from checkpoint, the shape in current model is torch.Size([512, 3, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock1.trans_dilao.weight: copying a param with shape torch.Size([3, 3, 3, 512, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 3, 3, 512]).
size mismatch for cylinder_3d_spconv_seg.upBlock1.conv1.weight: copying a param with shape torch.Size([1, 3, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 1, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.upBlock1.conv2.weight: copying a param with shape torch.Size([3, 1, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 1, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.upBlock1.conv3.weight: copying a param with shape torch.Size([3, 3, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.upBlock1.up_subm.weight: copying a param with shape torch.Size([3, 3, 3, 256, 256]) from checkpoint, the shape in current model is torch.Size([256, 3, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.upBlock2.trans_dilao.weight: copying a param with shape torch.Size([3, 3, 3, 256, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 3, 3, 256]).
size mismatch for cylinder_3d_spconv_seg.upBlock2.conv1.weight: copying a param with shape torch.Size([1, 3, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 1, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.upBlock2.conv2.weight: copying a param with shape torch.Size([3, 1, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 1, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.upBlock2.conv3.weight: copying a param with shape torch.Size([3, 3, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.upBlock2.up_subm.weight: copying a param with shape torch.Size([3, 3, 3, 128, 128]) from checkpoint, the shape in current model is torch.Size([128, 3, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.upBlock3.trans_dilao.weight: copying a param with shape torch.Size([3, 3, 3, 128, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 3, 128]).
size mismatch for cylinder_3d_spconv_seg.upBlock3.conv1.weight: copying a param with shape torch.Size([1, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.upBlock3.conv2.weight: copying a param with shape torch.Size([3, 1, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 1, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.upBlock3.conv3.weight: copying a param with shape torch.Size([3, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.upBlock3.up_subm.weight: copying a param with shape torch.Size([3, 3, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.ReconNet.conv1.weight: copying a param with shape torch.Size([3, 1, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 1, 1, 64]).
size mismatch for cylinder_3d_spconv_seg.ReconNet.conv1_2.weight: copying a param with shape torch.Size([1, 3, 1, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 3, 1, 64]).
size mismatch for cylinder_3d_spconv_seg.ReconNet.conv1_3.weight: copying a param with shape torch.Size([1, 1, 3, 64, 64]) from checkpoint, the shape in current model is torch.Size([64, 1, 1, 3, 64]).
size mismatch for cylinder_3d_spconv_seg.logits.weight: copying a param with shape torch.Size([3, 3, 3, 128, 20]) from checkpoint, the shape in current model is torch.Size([20, 3, 3, 3, 128]).

@xinge008
Copy link
Owner

Different version of spconv makes the difference. It should be spconv=1.2.1 for Cylinder3D in this repo.

@L-Reichardt
Copy link

Spconv 1.x -> 2.x introduced breaking changes of the algorithm. Use old Spconv, or rewritten version here for spconv-2.x (~80% faster).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants