hikvision-research / opera

A Unified Toolbox for Object Perception & Application
Apache License 2.0
139 stars 12 forks source link

load swin-l error #27

Open WEIZHIHONG720 opened 1 year ago

WEIZHIHONG720 commented 1 year ago

2023-02-09 22:24:00,150 - mmdet - INFO - Set random seed to 1703709815, deterministic: False 2023-02-09 22:24:02,166 - mmdet - INFO - load checkpoint from http path: https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window7_224_22kto1k.pth Traceback (most recent call last): File "./train.py", line 242, in main() File "./train.py", line 216, in main model.init_weights() File "/media/workspace/weizhihong/code/opera/third_party/mmcv/mmcv/runner/base_module.py", line 117, in init_weights m.init_weights() File "/media/workspace/weizhihong/code/opera/third_party/mmdetection/mmdet/models/backbones/swin.py", line 705, in init_weights if list(state_dict.keys())[0].startswith('module.'): IndexError: list index out of range

Yamameeee commented 1 year ago

You should add convert_weights=True to backbone config like official mmdet swin config.