Update retinanet_swin-t-p4-w7_fpn_1x_coco.py (#6973)

Fix the error encountered during loading the pretrained backbone as follows,

2022-01-10 09:45:12,308 - mmdet - INFO - load checkpoint from http path: https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_small_patch4_window7_224.pth
Traceback (most recent call last):
  File "tools/train.py", line 185, in <module>
    main()
  File "tools/train.py", line 159, in main
    model.init_weights()
  File "/home/shengliliu/anaconda3/envs/cots/lib/python3.7/site-packages/mmcv/runner/base_module.py", line 116, in init_weights
    m.init_weights()
  File "/home/shengliliu/anaconda3/envs/cots/lib/python3.7/site-packages/mmdet/models/backbones/swin.py", line 706, in init_weights
    if list(state_dict.keys())[0].startswith('module.'):
IndexError: list index out of range
pull/6998/head^2
ShengliLiu 3 years ago committed by GitHub
parent 3a00ade9c3
commit 12d0d6f2ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      configs/swin/retinanet_swin-t-p4-w7_fpn_1x_coco.py

@ -23,6 +23,7 @@ model = dict(
# Please only add indices that would be used
# in FPN, otherwise some parameter will not be used
with_cp=False,
convert_weights=True,
init_cfg=dict(type='Pretrained', checkpoint=pretrained)),
neck=dict(in_channels=[192, 384, 768], start_level=0, num_outs=5))

Loading…
Cancel
Save