Swin-Transformer-V2 icon indicating copy to clipboard operation
Swin-Transformer-V2 copied to clipboard

大佬,您能导入窗口为16的预训练权重吗

Open LUO77123 opened this issue 2 years ago • 0 comments

源码改建 (当我导入swinv2_tiny_patch4_window8_256.pth,使用窗口为8时候,可以正常跑代码;但是当我导入swinv2_tiny_patch4_window16_256.pth,使用窗口为16时候,导入权重出现不匹配情况;不知道如何处理,请大佬解答一下。 问题如下:) RuntimeError: Error(s) in loading state_dict for Model: size mismatch for model.7.blocks.0.attn.relative_coords_table: copying a param with shape torch.Size([1, 15, 15, 2]) from checkpoint, the shape in current model is torch.Size([1, 31, 31, 2]). size mismatch for model.7.blocks.0.attn.relative_position_index: copying a param with shape torch.Size([64, 64]) from checkpoint, the shape in current model is torch.Size([256, 256]). size mismatch for model.7.blocks.1.attn.relative_coords_table: copying a param with shape torch.Size([1, 15, 15, 2]) from checkpoint, the shape in current model is torch.Size([1, 31, 31, 2]). size mismatch for model.7.blocks.1.attn.relative_position_index: copying a param with shape torch.Size([64, 64]) from checkpoint, the shape in current model is torch.Size([256, 256]).

LUO77123 avatar Aug 16 '22 04:08 LUO77123