Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kelvennn opened this issue Nov 8, 2022 · 1 comment

Comments

@kelvennn
Copy link

kelvennn commented Nov 8, 2022

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?

@OmlineEditor
Copy link

it is possible, but this is not accurate, you need to specify an additional startup parameter: --large_model

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants