ConsistentTeacher icon indicating copy to clipboard operation
ConsistentTeacher copied to clipboard

How to match vision of mmdet with mmcv or mmcv-full?

Open Shawn9257 opened this issue 2 years ago • 2 comments

As show in readme file. I use mmcv == 1.7.2, however, when I use mmdet>2.25.3, it will give me:

ModuleNotFoundError: No module named 'mmcv._ext'
    ext_module = ext_loader.load_ext(
  File "/opt/conda/lib/python3.10/site-packages/mmcv/utils/ext_loader.py", line 13, in load_ext
    ext = importlib.import_module('mmcv.' + name)
  File "/opt/conda/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named 'mmcv._ext' 

and for lower vision of mmdet like mmdet==2.24.1, it will give me that :

Traceback (most recent call last):
  File "/root/workdir/ConsistentTeacher/tools/train.py", line 14, in <module>
    from mmdet import __version__
  File "/opt/conda/lib/python3.10/site-packages/mmdet/__init__.py", line 25, in <module>
    and mmcv_version <= digit_version(mmcv_maximum_version)), \
AssertionError: MMCV==1.7.2 is used but incompatible. Please install mmcv>=1.3.17, <=1.7.0.
Traceback (most recent call last):
  File "/root/workdir/ConsistentTeacher/tools/train.py", line 14, in <module>
    from mmdet import __version__
  File "/opt/conda/lib/python3.10/site-packages/mmdet/__init__.py", line 25, in <module>
    and mmcv_version <= digit_version(mmcv_maximum_version)), \
AssertionError: MMCV==1.7.2 is used but incompatible. Please install mmcv>=1.3.17, <=1.7.0.

and for the new vision it is not match to mmdet 3.X.

The environment is here:

torch==1.12.0
torchaudio==0.12.0
mmcv ==1.7.0
mmcv-full ==1.7.2
mmdet== 2.25.3
mmengine == 0.10.2 
CUDA = 11.6

What is the correct vision of mmdet?

Shawn9257 avatar Jan 22 '24 01:01 Shawn9257

I have the same problem as you, how did you solve it?

SORYZheng avatar May 06 '25 02:05 SORYZheng

Limited by the PyTorch version and the Windows system, I couldn't solve this problem according to the official documentation at https://mmdetection3d.readthedocs.io/en/dev/faq.html.

Here is the official documentation for the new version (using the new version might require substantial code modifications): https://mmdetection3d.readthedocs.io/en/latest/notes/faq.html.

Perhaps you can find an mmcv==1.7.1 version that suits your CUDA and PyTorch versions through https://download.openmmlab.com/mmcv/dist/cu113/torch1.10.0/index.html.

I've checked other comments regarding the mmcv version, and it seems that the official documentation might not be entirely accurate. For example, according to the official documentation, for certain configurations, it's specified as mmdet>=2.24.0, \<=3.0.0, mmseg>=0.20.0, \<=1.0.0, and mmcv-full>=1.5.2, \<=1.7.0. However, in reality, some versions with mmseg>=0.24.0 and mmcv-full>=1.5.2 don't seem to be compatible with mmdet>=2.24.0.

Based on my observations, it's advisable to prioritize finding a suitable mmcv==1.7.1 version (I initially used mmcv==1.7.2, but it was incompatible due to device - related reasons).

Shawn9257 avatar May 06 '25 02:05 Shawn9257