Sense-X / Co-DETR

[ICCV 2023] DETRs with Collaborative Hybrid Assignments Training
MIT License
968 stars 105 forks source link

"CoDETR: 'CoATSSHead is not in the models registry' #100

Closed ninatu closed 8 months ago

ninatu commented 9 months ago

Hi! I have read all related issues but didn't find a solution for my "CoDETR: 'CoATSSHead is not in the models registry' error (and the error message slightly differs from what was already discussed). I follow all recommended package versions:

conda create python=3.7.11 -y -n codetr
conda activate codetr
conda install -y pytorch==1.11.0 torchvision==0.12.0 torchaudio==0.11.0 cudatoolkit=11.3 -c pytorch
pip install mmcv-full==1.5.0 -f https://download.openmmlab.com/mmcv/dist/cu113/torch1.11.0/index.html
pip install fairscale timm
pip install -v -e  .

But when I run bash tools/dist_test.sh projects/configs/co_dino/co_dino_5scale_swin_large_16e_o365tococo.py pretrained/co_dino_5scale_swin_large_16e_o365tococo.pth 2 --eval bbox I get KeyError: 'CoATSSHead is not in the models registry' error.

I've also tried pip uninstall mmdet, it didn't help. Could you advise me on how to fix this issue?

TempleX98 commented 8 months ago

Another solution is to move the CoATSSHead file to mmdet/models/dense_heads and register this module in mmdet/models/dense_heads/__init__.py

ninatu commented 8 months ago

Thanks! Simply coping all files from projects/models to mmdet/models resolved all issues: cp -r projects/models mmdet/models/co_detr