Skip to content
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

[Bug] MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0. #2024

Open
2 tasks done
pure-wei opened this issue Feb 13, 2024 · 9 comments
Open
2 tasks done
Assignees

Comments

@pure-wei
Copy link

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

main branch https://github.com/open-mmlab/mmocr

Environment

python 3.11.5 pytorch 2.1.2 cuda 12.1

Reproduces the problem - code sample

!pip install -U openmim
!pip install opencv-python pillow matplotlib seaborn tqdm -i https://pypi.tuna.tsinghua.edu.cn/simple
!git clone https://github.com/open-mmlab/mmocr.git
!mim install -e .
import mmocr

print(dir(mmocr))
print(dir(mmcv))

AssertionError Traceback (most recent call last)
Cell In[7], line 2
1 # 检查 mmocr
----> 2 import mmocr
3 #print('mmocr版本', mmocr.version)
4 print(dir(mmocr))

File c:\Users\rhwto\Desktop\code\github\MMOCR_tutorials-main\20230620\mmocr\mmocr_init_.py:4
1 # Copyright (c) OpenMMLab. All rights reserved.
3 import mmcv
----> 4 import mmdet
6 try:
7 import mmengine

File c:\Users\rhwto\anaconda3\Lib\site-packages\mmdet_init_.py:17
13 mmengine_maximum_version = '1.0.0'
14 mmengine_version = digit_version(mmengine.version)
16 assert (mmcv_version >= digit_version(mmcv_minimum_version)
---> 17 and mmcv_version < digit_version(mmcv_maximum_version)),
18 f'MMCV=={mmcv.version} is used but incompatible. '
19 f'Please install mmcv>={mmcv_minimum_version}, <{mmcv_maximum_version}.'
21 assert (mmengine_version >= digit_version(mmengine_minimum_version)
22 and mmengine_version < digit_version(mmengine_maximum_version)),
23 f'MMEngine=={mmengine.version} is used but incompatible. '
24 f'Please install mmengine>={mmengine_minimum_version}, '
25 f'<{mmengine_maximum_version}.'
27 all = ['version', 'version_info', 'digit_version']

AssertionError: MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0.

Reproduces the problem - command or script


AssertionError Traceback (most recent call last)
Cell In[7], line 2
1 # 检查 mmocr
----> 2 import mmocr
3 #print('mmocr版本', mmocr.version)
4 print(dir(mmocr))

File c:\Users\rhwto\Desktop\code\github\MMOCR_tutorials-main\20230620\mmocr\mmocr_init_.py:4
1 # Copyright (c) OpenMMLab. All rights reserved.
3 import mmcv
----> 4 import mmdet
6 try:
7 import mmengine

File c:\Users\rhwto\anaconda3\Lib\site-packages\mmdet_init_.py:17
13 mmengine_maximum_version = '1.0.0'
14 mmengine_version = digit_version(mmengine.version)
16 assert (mmcv_version >= digit_version(mmcv_minimum_version)
---> 17 and mmcv_version < digit_version(mmcv_maximum_version)),
18 f'MMCV=={mmcv.version} is used but incompatible. '
19 f'Please install mmcv>={mmcv_minimum_version}, <{mmcv_maximum_version}.'
21 assert (mmengine_version >= digit_version(mmengine_minimum_version)
22 and mmengine_version < digit_version(mmengine_maximum_version)),
23 f'MMEngine=={mmengine.version} is used but incompatible. '
24 f'Please install mmengine>={mmengine_minimum_version}, '
25 f'<{mmengine_maximum_version}.'
27 all = ['version', 'version_info', 'digit_version']

AssertionError: MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0.

Reproduces the problem - error message


AssertionError Traceback (most recent call last)
Cell In[7], line 2
1 # 检查 mmocr
----> 2 import mmocr
3 #print('mmocr版本', mmocr.version)
4 print(dir(mmocr))

File c:\Users\rhwto\Desktop\code\github\MMOCR_tutorials-main\20230620\mmocr\mmocr_init_.py:4
1 # Copyright (c) OpenMMLab. All rights reserved.
3 import mmcv
----> 4 import mmdet
6 try:
7 import mmengine

File c:\Users\rhwto\anaconda3\Lib\site-packages\mmdet_init_.py:17
13 mmengine_maximum_version = '1.0.0'
14 mmengine_version = digit_version(mmengine.version)
16 assert (mmcv_version >= digit_version(mmcv_minimum_version)
---> 17 and mmcv_version < digit_version(mmcv_maximum_version)),
18 f'MMCV=={mmcv.version} is used but incompatible. '
19 f'Please install mmcv>={mmcv_minimum_version}, <{mmcv_maximum_version}.'
21 assert (mmengine_version >= digit_version(mmengine_minimum_version)
22 and mmengine_version < digit_version(mmengine_maximum_version)),
23 f'MMEngine=={mmengine.version} is used but incompatible. '
24 f'Please install mmengine>={mmengine_minimum_version}, '
25 f'<{mmengine_maximum_version}.'
27 all = ['version', 'version_info', 'digit_version']

AssertionError: MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0.

Additional information

please fix the error with cuda file,and i can't find the preciously compatible version that works

@yechaoying
Copy link

I uninstalled mmcv==2.1.0 and installed mmcv==2.0.0 as the AssertionError said. But after "import mmselfsup", there are"UserWarning: Cannot import torch.fx, merge_dict is a simple function to merge multiple dicts".

@d9j
Copy link

d9j commented Mar 29, 2024

this project appears to be not maintained well.. it requires deprecated python 3.8 which been dropped even by anaconda.

@DeShinHwa
Copy link

Hi, did u solve it ?

@zhouzaida
Copy link
Member

Hi, you could try to uninstall mmcv and install mmcv==2.0.0 via mim install mmcv==2.0.0.

@MiXaiLL76
Copy link
Contributor

MiXaiLL76 commented Apr 16, 2024

MiXaiLL76@922bc32

Do something like this

@zhouzaida
When will there be an update with the latest dependencies?
Maybe it's worth going with the correct format and specifying dependencies in the installation files?

But it turns out that they are right in init.py, which doesn’t look very good

@Yoanes-Yeo
Copy link

I've tried everything that i can, I still having the issue same like this... ' ERROR: Failed building wheel for mmcv
Running setup.py clean for mmcv
Failed to build mmcv
ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects'

@DeShinHwa
Copy link

I've tried everything that i can, I still having the issue same like this... ' ERROR: Failed building wheel for mmcv Running setup.py clean for mmcv Failed to build mmcv ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects'

If your pytorch version is 2.1.0, cuda 12.1. U can use this code below to install the specify version of the mmcv. It works for me.
pip install mmcv==2.1.0 -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1/index.html

@MiXaiLL76
Copy link
Contributor

fixed with #2023

install from git

@drzraf
Copy link

drzraf commented May 3, 2024

see also #2041

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

9 participants