open-mmlab / mmpose

OpenMMLab Pose Estimation Toolbox and Benchmark.
https://mmpose.readthedocs.io/en/latest/
Apache License 2.0
5.4k stars 1.18k forks source link

Bug in swin backbone #1993

Closed Jaykob closed 1 year ago

Jaykob commented 1 year ago

Describe the bug

When trying to train a swin net, for example with configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_swin-b-p4-w7_8xb32-210e_coco-256x192.py, it fails because in line 680 https://github.com/open-mmlab/mmpose/blob/3b0b41bdd9710e17e8ea29e6e0e0b8b6322683b7/mmpose/models/backbones/swin.py#L680 you try to access the first element of an empty OrderedDict (just created one line above). Did you mean to access _state_dict instead of state_dict?

Reproduction

 python tools/train.py configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_swin-b-p4-w7_8xb32-210e_coco-256x192.py
configs/body_2d_keypoint/topdown_heatmap/coco/td-hm_swin-b-p4-w7_8xb32-210e_coco-384x288.py
ly015 commented 1 year ago

Thanks very much for reporting this bug. We will fix it asap.

ly015 commented 1 year ago

This bug will be fixed in #1995 in dev-1.x branch first. And it will be merged into the mainstream 1.x branch in the next release, which should be soon.

Jaykob commented 1 year ago

Nice, thanks for the very quick fix 🙂