Open ztMotaLee opened 10 months ago
so do I
RuntimeError: Error(s) in loading state_dict for SparseMat: size mismatch for shm.backbone.conv1.weight: copying a param with shape torch.Size([3, 3, 4, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 4]).
I encountered the same issue. The SparseResNet18
has a setting called in_planes
which was set to 128 while initiating, it has 3 SparseConv2D layers that turns x from shape [N, 4]
into [N, 64]
, but then layer1 in SparseResNet18 wants to see a tensor of [N, 128]
instantly. Your help would be appreciated!
我改成功了 不过又出现了新的报错
Hello Thank you for your wonderful work on Image Matting! I encountered some problems when testing the pretrained model: It seems that the pretrained model you provided does not match the shape of the network, for example:
... RuntimeError: Error(s) in loading state_dict for SparseMat: size mismatch for shm.backbone.conv1.weight: copying a param with shape torch.Size([3, 3, 4, 64]) from checkpoint, the shape in current model is torch.Size([64, 3, 3, 4]).
At the same time, when I tried to retrain the model, I encountered the following problems: ... SparseMat-main/model/backbones/sparse_resnet_bn.py", line 61, in forward out = self.conv1(x) ... AssertionError: channel size mismatch.
Could you please check the code carefully or provide a corrected version? Thank you very much for your attention to these matters and for your dedication to open-source development.