SwinTransformer / Swin-Transformer-Object-Detection

This is an official implementation for "Swin Transformer: Hierarchical Vision Transformer using Shifted Windows" on Object Detection and Instance Segmentation.
https://arxiv.org/abs/2103.14030
Apache License 2.0
1.79k stars 378 forks source link

在构建检测器的时候显示:KeyError: "CascadeRCNN: 'SwinTransformer is not in the backbone registry'" #9

Closed TfeiSong closed 2 years ago

TfeiSong commented 3 years ago

执行这行时: model = build_detector( cfg.model, train_cfg=cfg.get('train_cfg'), test_cfg=cfg.get('test_cfg'))

出现如下错误: KeyError: "CascadeRCNN: 'SwinTransformer is not in the backbone registry'"

leiqing1 commented 3 years ago

需要把下载的Swin-Transformer-Object-Detection工程安装下,执行python setup.py develop 后,即可正常运行.

HHaa-gif commented 3 years ago

修改mmdet版本为2.11.0

Lodour commented 3 years ago

补充说明一下,README 里链接的安装步骤 get_started 是针对 MMDetection 的,具体问题在下面这一步:

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e .  # or "python setup.py develop"

这里应该改成:

git clone https://github.com/SwinTransformer/Swin-Transformer-Object-Detection.git
cd Swin-Transformer-Object-Detection
pip install -r requirements/build.txt
python setup.py develop

尽量避免跑上面那一份代码,否则可能会导致一些奇怪的问题,建议作者在 README 里说明一下。

impiga commented 2 years ago

As @leiqing1 and @Lodour figured out, please run python setup.py develop in the Swin-Transformer-Object-Detection folder.