open-mmlab / mmcv

OpenMMLab Computer Vision Foundation
https://mmcv.readthedocs.io/en/latest/
Apache License 2.0
5.91k stars 1.65k forks source link

[Bug] ImportError: cannot import name 'MODELS' from 'mmcv.cnn' ,安装的是mmcv2.0.0.rc4也不行 #3178

Open hellowwrod opened 2 months ago

hellowwrod commented 2 months ago

Prerequisite

Environment

pytorch 1.13.0+cu117 mmcv 2.0.0.rc4

Reproduces the problem - code sample

from mmcv.cnn import MODELS as MMCV_MODELS from mmcv.utils import Registry

Reproduces the problem - command or script

File "/home/mmyolo/mmyolo/models/builder.py", line 4, in from mmcv.cnn import MODELS as MMCV_MODELS ImportError: cannot import name 'MODELS' from 'mmcv.cnn' (/opt/conda/envs/wyh-yolo/lib/python3.8/site-packages/mmcv/cnn/init.py)

Reproduces the problem - error message

ImportError: cannot import name 'MODELS' from 'mmcv.cnn' (/opt/conda/envs/wyh-yolo/lib/python3.8/site-packages/mmcv/cnn/init.py)

Additional information

dont know

ZyoungXu commented 1 week ago

I have the same problem