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

Evaluation with Swin-large ckpt came across loading ckpt error. Can you provide the script to evaluate with Swin-large? #15

Open
shaniaos opened this issue Sep 21, 2023 · 1 comment

Comments

@shaniaos
Copy link

Hi,
Thanks for your great work! I'm very impressed by the strong performance of your method and trying to reproduce the result on Swin-large. However, as only the swin-tiny evaluation script is provided and not the swin-large, I tried to run with swin-large ckpt by replacing "--backbone swin_tiny" with "--backbone swin_large". However, I came across such error:

        size mismatch for backbone.0.body.layers.2.blocks.4.attn.relative_position_index: copying a param with shape torch.Size([144, 144]) from checkpoint, the shape in current model is torch.Size([49, 49]).

How can I fix this and run with your swin-large ckpt? Can you provide the evaluation script for swin-large?
I'm looking forward to your reply. Thanks a lot!

@TimandXiyu
Copy link

Use swin_large_384 as the parameter instead of swin_large. Leave pretrain_model_path "". If it still asks for the pretrained swin tiny model, then just comment out that related code segment to avoid loading it.
The loading logic is in backbone.py, it only detects key words, i.e., swin, large, and 384.

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