open-mmlab / mmocr

OpenMMLab Text Detection, Recognition and Understanding Toolbox
https://mmocr.readthedocs.io/en/dev-1.x/
Apache License 2.0
4.18k stars 735 forks source link

[Bug] MMDETECTION is incompatible with MMOCR #2000

Open ozzmanmuhammad opened 8 months ago

ozzmanmuhammad commented 8 months ago

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

!pip install -U openmim !mim install mmengine !mim install 'mmcv>=2.0.0rc1' !mim install 'mmdet>=3.0.0rc0'

Reproduces the problem - code sample

https://colab.research.google.com/github/open-mmlab/mmocr/blob/dev-1.x/demo/tutorial.ipynb

Reproduces the problem - command or script

from mmocr.apis import MMOCRInferencer

Reproduces the problem - error message

AssertionError: MMDetection 3.2.0 is incompatible with MMOCR 1.0.1. Please use MMDetection >= 3.0.0rc5, < 3.2.0 instead.

Additional information

I tried to install mmocr using mim and followed instructions. On runing the from mmocr.apis import MMOCRInferencer I got AssertionError: MMDetection 3.2.0 is incompatible with MMOCR 1.0.1. Please use MMDetection >= 3.0.0rc5, < 3.2.0 instead. After that I tried to do pip install mmdet==3.1.0, but then I got ERROR: Failed building wheel for mmcv. Could say I got into cycle. I didn't found any issue with this problem. Also this code was working fine a month ago but after the latest update of mmdet 3.2.0 (start of the October 2023), I'm getting this error. Do you know what I can do with this problem or this is some sort of bug?

branisk commented 8 months ago

The issue seems to be the non-inclusivity of the maximum version error checks in the init.py file after the update. I've created pull request #2001 to satisfy this issue.

cpprust commented 7 months ago

I install mmocr with these, and it works:

pip install "torch==2.0" "torchvision==0.15" "openmim"
mim install mmocr

[ref] https://github.com/open-mmlab/mmcv/issues/2938#issuecomment-1751591975 https://pypi.org/project/torchvision/

[note] Test with: python: 3.11.6 environment: venv

baibhab07 commented 7 months ago

You can find the required dependencies in the following https://mmocr.readthedocs.io/en/dev-1.x/get_started/install.html#dependency-on-mmengine-mmcv-mmdetection

Using the link provided above. You can install mmocr by following the code below

!pip install torch==2.0.0 torchvision==0.15.1
!pip install -U openmim
!mim install "mmengine>=0.7.1,<1.1.0"
!mim install "mmcv>=2.0.0rc4,<2.1.0"
!mim install "mmdet>=3.0.0rc5,<3.2.0"
!mim install mmocr
MohamedAliRashad commented 5 months ago

@baibhab07 I tried the versions you proposed and it still gives me an error

MiXaiLL76 commented 4 months ago

bump, update mmocr to support new features