ouenal / scribblekitti

Scribble-Supervised LiDAR Semantic Segmentation, CVPR 2022 (ORAL)
https://ouenal.github.io/scribblekitti/
142 stars 17 forks source link

Size Mismatch #10

Closed christophTUM closed 1 year ago

christophTUM commented 1 year ago

When trying to evaluate on my own files, without labels, i get the following error message:

Traceback (most recent call last):
  File "evaluate.py", line 38, in <module>
    model = LightningEvaluator.load_from_checkpoint(args.ckpt_path, config=config)
  File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 159, in load_from_checkpoint
    model = cls._load_model_state(checkpoint, strict=strict, **kwargs)
  File "/root/miniconda3/lib/python3.8/site-packages/pytorch_lightning/core/saving.py", line 205, in _load_model_state
    model.load_state_dict(checkpoint['state_dict'], strict=strict)
  File "/root/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1482, in load_state_dict
    raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(
RuntimeError: Error(s) in loading state_dict for LightningEvaluator:
    size mismatch for student.unet.contextBlock.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 student.unet.contextBlock.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 student.unet.contextBlock.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 student.unet.contextBlock.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 student.unet.resBlock0.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 student.unet.resBlock0.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 student.unet.resBlock0.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 student.unet.resBlock0.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 student.unet.resBlock0.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 student.unet.resBlock1.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 student.unet.resBlock1.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 student.unet.resBlock1.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 student.unet.resBlock1.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 student.unet.resBlock1.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 student.unet.resBlock2.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 student.unet.resBlock2.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 student.unet.resBlock2.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 student.unet.resBlock2.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 student.unet.resBlock2.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 student.unet.resBlock3.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 student.unet.resBlock3.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 student.unet.resBlock3.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 student.unet.resBlock3.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 student.unet.resBlock3.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.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 student.unet.reconBlock.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 student.unet.reconBlock.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 student.unet.reconBlock.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 student.unet.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]).
    size mismatch for teacher.unet.contextBlock.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 teacher.unet.contextBlock.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 teacher.unet.contextBlock.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 teacher.unet.contextBlock.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 teacher.unet.resBlock0.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 teacher.unet.resBlock0.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 teacher.unet.resBlock0.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 teacher.unet.resBlock0.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 teacher.unet.resBlock0.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 teacher.unet.resBlock1.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 teacher.unet.resBlock1.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 teacher.unet.resBlock1.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 teacher.unet.resBlock1.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 teacher.unet.resBlock1.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 teacher.unet.resBlock2.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 teacher.unet.resBlock2.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 teacher.unet.resBlock2.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 teacher.unet.resBlock2.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 teacher.unet.resBlock2.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 teacher.unet.resBlock3.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 teacher.unet.resBlock3.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 teacher.unet.resBlock3.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 teacher.unet.resBlock3.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 teacher.unet.resBlock3.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.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 teacher.unet.reconBlock.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 teacher.unet.reconBlock.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 teacher.unet.reconBlock.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 teacher.unet.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]).

It seems like the dimensions of the array are mixed up?

ouenal commented 1 year ago

This is very strange, I can't seem to reproduce it. Did you change anything in the repository?

christophTUM commented 1 year ago

I adapted some imports so that the repo works with spconv 2.x, because v. 1.x is deprecated.

ouenal commented 1 year ago

I never tested the code with spconv 2.x, the issue is most likely due to changes to the library. Please follow up with them to resolve the issue.