mmocr
mmocr copied to clipboard
[Bug] MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.
Prerequisite
- [X] I have searched Issues and Discussions but cannot get the expected help.
- [X] The bug has not been fixed in the latest version (0.x) or latest version (1.x).
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
----system env---- CUDA: 12.3 System: Linux(Centos8) Python: 3.8 Pytorch: 2.1.2
Reproduces the problem - code sample
from mmocr.apis import MMOCRInferencer ocr = MMOCRInferencer(det='DBNet', rec='CRNN') ocr('demo/demo_text_ocr.jpg', show=True, print_result=True)
Reproduces the problem - command or script
- 运行安装文档中的代码 git clone https://github.com/open-mmlab/mmocr.git cd mmocr pip install -v -e .
- 安装openmim、mmengine、mmcv、mmdet pip install -U openmim mim install mmengine mim install mmcv mim install mmdet
- 运行安装文档中的示例代码 from mmocr.apis import MMOCRInferencer ocr = MMOCRInferencer(det='DBNet', rec='CRNN') ocr('demo/demo_text_ocr.jpg', show=True, print_result=True)
- 安装mmocr
Reproduces the problem - error message
根据安装文档安装得到的mm库版本: mmengine: 0.10.3 mmcv: 2.2.0 mmdet: 3.3.0 mmocr: 1.0.1 运行文档的示例代码会报错,提示mmdet版本与mmocr不兼容 MMDetection 3.3.0 is incompatible with MMOCR 1.0.1. Please use MMDetection >= 3.0.0rc5, < 3.2.0 instead. 于是卸载mmdet重新下载了3.0.0rc5版本 再次运行示例代码,提示mmcv版本被使用,但不兼容 MMCV==2.2.0 is used but incompatible. please install mmcv>=2.0.0rc4,<2.2.0. 卸载mmcv重新下载2.0.0rcx(x表示1/2/3/4任意版本)或2.0.1等版本会在命令行提示如下报错 note: This error originates from a subprocess, and is likely not a problem with pip. 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 ---mmcv 的下载--- try to install mmcv from source. https://mmcv.readthedocs.io/en/latest/get_started/build.html#build-mmcv 可以build但版本仍然是2.2.0,也会报错 MMCV==2.2.0 is used but incompatible. please install mmcv>=2.0.0rc4,<2.2.0.
Additional information
No response
Similar to https://github.com/open-mmlab/mmdetection/issues/11668
Solved the same problems by specifying the version of mmcv during installation.
- uninstall mmcv with code below in your virtual env for mmdetection:
mim uninstall mmcv
- to specify the version of mmcv, you can use the following command:
mim install "mmcv==2.1.0"
It's not necessary to use 2.1.0, but I just tried this one and it works for me
or maybe just change the maximum version as #11668 suggested Hope this could help! I guess OpenMMLab will fix it soon.
Solved the same problems by specifying the version of mmcv during installation.
- uninstall mmcv with code below in your virtual env for mmdetection:
mim uninstall mmcv
- to specify the version of mmcv, you can use the following command:
mim install "mmcv==2.1.0"
It's not necessary to use 2.1.0, but I just tried this one and it works for meor maybe just change the maximum version as #11668 suggested Hope this could help! I guess OpenMMLab will fix it soon.
I specified the version of mmcv as you suggested, then I followed the suggestion in #11668. It works now, thank you!!!
Similar to open-mmlab/mmdetection#11668
I followed the suggestion in #11668. It works now, thank you!!!
Running the following command shows that mmcv 2.1.0 was installed but when I import it and check the version, it shows 2.2.0 (???) and the error persists.
mim install "mmcv==2.1.0"
I've been trying to install this tool for the last 4 hours and still stuck on this error. I've tried installing with pip, mim, and from source.
Running the following command shows that mmcv 2.1.0 was installed but when I import it and check the version, it shows 2.2.0 (???) and the error persists.
mim install "mmcv==2.1.0"
I've been trying to install this tool for the last 4 hours and still stuck on this error. I've tried installing with pip, mim, and from source.
same error, have you fixed it?
@WEI9957 I just tried @TanHaonan 's solution and it works.Will test it further.
pip install mmcv mmagic mmdet3d mmsegmentation mmocr mmdet
...... Building wheels for collected packages: mmcv Building wheel for mmcv (setup.py) ... done Created wheel for mmcv: filename=mmcv-2.2.0-cp310-cp310-win_amd64.whl size=9550520 sha256=baf744a32ad712eb8ca37a79dab1e74bef67297e231b61ae33cc7be9c2ee573e Stored in directory: c:\users***\appdata\local\pip\cache\wheels\e3\ff\a5\2d2658bede6cbb4153c0165397f03110d556c54cc061a1d9bb Successfully built mmcv Installing collected packages: mmsegmentation, mmocr, mmdet, mmcv, mmagic, mmdet3d Successfully installed mmagic-1.2.0 mmcv-2.2.0 mmdet-3.3.0 mmdet3d-1.4.0 mmocr-1.0.1 mmsegmentation-1.2.2 ...... fix it.