-
Notifications
You must be signed in to change notification settings - Fork 384
KeyError: "CascadeRCNN: 'backbone.layers.0.blocks.0.attn.relative_position_bias_table'" #4
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
Comments
I think the reason is the pretrained model you used is the one finetuned on COCO det, not the one from ImageNet pretrain. You'd better use the corresponding model held on this page. |
I've tried to print some infomation at there thanks to your reminding. ...
relative_position_bias_table_keys = [k for k in state_dict.keys() if "relative_position_bias_table" in k]
# insert code
print(relative_position_bias_table_keys)
print([k for k in model.state_dict().keys() if "relative_position_bias_table" in k])
... |
Maybe this is the keypoint, I'll try it. |
It works. Thanks. |
Good to know! |
Thank you. @weiyx16 because I'm trying to train custom detection dataset on Swin Transformer-Object Detection. |
I had the same problem. |
Does anybody know that? I want to finetune the COCO pre-trained weights to my own dataset. |
What was the conclusion? Which is the correct base model from this page |
Hi, did you solve this ? I also encountered it today and did't solve yet. |
使用config文件中load_from关键字进行加载预训练模型,不要使用参数--cfg-options model.pretrained=<PRETRAIN_MODEL> [model.backbone.use_checkpoint=True] [other optional arguments] 这种方式加载模型 |
适用于:调用训练好的模型继续优化 |
Thanks for your work!
I occured the error when I run the code.

I run the command:
python tools/train.py configs/swin/mydef_cascade_mask_rcnn_swin_small_patch4_window7_mstrain_480-800_giou_4conv1f_adamw_3x_coco.py --cfg-options model.pretrained=./models/cascade_mask_rcnn_swin_small_patch4_window7.pth
How to solve it?
The text was updated successfully, but these errors were encountered: