Skip to content

[Bug] ModuleNotFoundError: No module named 'mmdet' inside the container #3184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
LeonardTwcs opened this issue Jan 30, 2025 · 2 comments
Open
2 tasks done

Comments

@LeonardTwcs
Copy link

LeonardTwcs commented Jan 30, 2025

Prerequisite

Environment

I tried to run the demo

python demo/topdown_demo_with_mmdet.py
demo/mmdetection_cfg/rtmdet_m_8xb32-300e_coco.py
https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet_m_8xb32-300e_coco/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth
configs/animal_2d_keypoint/topdown_heatmap/animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py
https://download.openmmlab.com/mmpose/animal/hrnet/hrnet_w32_animalpose_256x256-1aa7f075_20210426.pth
--input tests/data/animalpose/ca110.jpeg
--output-root vis_results --save-predictions --draw-heatmap --det-cat-id=15

inside the provided container and I got the issue ModuleNotFoundError: No module named 'mmdet'. It can be solved by installing mmdet with pip but then I got AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0. einstalling a compatible version of mmcv takes a lot of time because of the Building wheel for mmcv (setup.py).

Any suggestions to fix it?

Reproduces the problem - code sample

docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmpose/data mmpose

python demo/topdown_demo_with_mmdet.py
demo/mmdetection_cfg/rtmdet_m_8xb32-300e_coco.py
https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet_m_8xb32-300e_coco/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth
configs/animal_2d_keypoint/topdown_heatmap/animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py
https://download.openmmlab.com/mmpose/animal/hrnet/hrnet_w32_animalpose_256x256-1aa7f075_20210426.pth
--input tests/data/animalpose/ca110.jpeg
--output-root vis_results --save-predictions --draw-heatmap --det-cat-id=15

Reproduces the problem - command or script

docker run --gpus all --shm-size=8g -it -v {DATA_DIR}:/mmpose/data mmpose

python demo/topdown_demo_with_mmdet.py
demo/mmdetection_cfg/rtmdet_m_8xb32-300e_coco.py
https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet_m_8xb32-300e_coco/rtmdet_m_8xb32-300e_coco_20220719_112220-229f527c.pth
configs/animal_2d_keypoint/topdown_heatmap/animalpose/td-hm_hrnet-w32_8xb64-210e_animalpose-256x256.py
https://download.openmmlab.com/mmpose/animal/hrnet/hrnet_w32_animalpose_256x256-1aa7f075_20210426.pth
--input tests/data/animalpose/ca110.jpeg
--output-root vis_results --save-predictions --draw-heatmap --det-cat-id=15

Reproduces the problem - error message

ModuleNotFoundError: No module named 'mmdet'

Additional information

No response

@Aleman-Z
Copy link

Aleman-Z commented Mar 2, 2025

I get the same

@ChernyakKonstantin
Copy link

ChernyakKonstantin commented Mar 19, 2025

To fix the issue modify docker/Dockerfile as follows:

Before:

# Install MMEngine and MMCV
RUN pip install openmim
RUN mim install mmengine "mmcv>=2.0.0"

After:

# Install MMEngine, MMCV and MMDet
RUN pip install openmim
RUN mim install mmengine "mmcv>=2.0.0"
RUN mim install mmdet==3.0.0

If you want to install other version, keep in mind the following (that's why I picked mmdet==3.0.0):

mmpose 1.3.2 requires mmdet<3.3.0,>=3.0.0, but you have mmdet 3.3.0 which is incompatible.

Tested at commit hash 71ec36ebd63c475ab589afc817868e749a61491f

@ly015 FIY (sorry, I don't know whom to tag)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants