JingyunLiang / SwinIR

SwinIR: Image Restoration Using Swin Transformer (official repository)

Home Page:https://arxiv.org/abs/2108.10257

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to fix the error in loading trained xxxx_E.pth: tensors size cant match ?

kelvennn opened this issue · comments

I finetuned the classical SwinIR model, then load the xxxx_E.pth for testing.
I met that problem:

RuntimeError: Error(s) in loading state_dict for SwinIR:
size mismatch for layers.0.residual_group.blocks.1.attn_mask: copying a param with shape torch.Size([4, 64, 64]) from checkpoint, the shape in current m odel is torch.Size([64, 64, 64]).

how to fix it?