huochaitiantang / pytorch-deep-image-matting

Pytorch implementation of deep image matting
294 stars 71 forks source link

size mismatch for conv6_1.weight: copying a param with shape torch.Size([512, 512, 1, 1]) #27

Open flyfish01 opened 4 years ago

flyfish01 commented 4 years ago

Hi,

I download the stage1_sad_57.1.pth, and run python core/demo.py, i got below error, how to resove it, thank you!

RuntimeError: Error(s) in loading state_dict for VGG16: size mismatch for conv6_1.weight: copying a param with shape torch.Size([512, 512, 1, 1]) from checkpoint, the shape in current model is torch.Size([512, 512, 3, 3]).

huochaitiantang commented 4 years ago

Please see the 2019.09.09 Updates in README.md.

flyfish01 commented 4 years ago

OK, got it! thank you!

conv6 kernel size from 1x1 to 3x3. Get Stage1-SAD=54.4. The performance of stage1 is as good as paper. While using model released before this day, please change the kernel_size=1 and padding=0 of conv6 in file core/net.py.