open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.56k stars 9.46k forks source link

AssertionError: MMCV==2.0.0 is used but incompatible. Please install mmcv>=1.3.17, <=1.8.0. #10104

Open Latitude9527 opened 1 year ago

Latitude9527 commented 1 year ago

i had download the latest MMdetection-main and installed mmcv=2.0.0,but when i run the code ,it tell me issue like the title,i had tried to install mmcv-full=1.7.1 ,but it need run with mmcv.transformer and this model does not exsist in mmcv=full

kimlia545 commented 1 year ago

Hi, @Latitude9527 works for me

torch.version
'1.9.0+cu111'
mmcv.version
'2.0.0rc4'
mmdet.version
'3.0.0'

# install mmengine
git clone https://github.com/open-mmlab/mmengine.git
cd mmengine
pip install -e . -v

# install torch https://pytorch.org/get-started/previous-versions/ 
# check torch version
python -c 'import torch;print(torch.__version__);print(torch.version.cuda)'

# install mmcv 
# pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
pip install mmcv==2.0.0rc4 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9/index.html

# install mmdet
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -v -e .

# download checkpoint 
# check it works
 python3 demo/image_demo.py demo/demo.jpg configs/rtmdet/rtmdet_tiny_8xb32-300e_coco.py --weights rtmdet_tiny_8xb32-300e_coco_20220902_112414-78e30dcc.pth --device cpu --show
Juin28 commented 1 year ago

Mine shows this error when running the second code to check for the torch version, could anyone help?

'import ^ SyntaxError: EOL while scanning string literal

Latitude9527 commented 1 year ago

ok ,thanks

hoseinCode commented 1 year ago

hi i have error: AssertionError: MMCV==2.0.1 is used but incompatible. Please install mmcv>=1.3.15, <1.8.0. i did above solution that kimlia545 said, but error did not solve

TranDo25 commented 1 year ago

Traceback (most recent call last): File "demo/image_demo.py", line 43, in from mmdet.apis import DetInferencer File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\apis__init.py", line 2, in from .det_inferencer import DetInferencer File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\apis\det_inferencer.py", line 21, in from mmdet.evaluation import INSTANCE_OFFSET File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\evaluation__init.py", line 3, in from .metrics import * # noqa: F401,F403 File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\evaluation\metrics__init__.py", line 5, in from .coco_metric import CocoMetric File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\evaluation\metrics\coco_metric.py", line 16, in from mmdet.datasets.api_wrappers import COCO, COCOeval File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\datasets\init.py", line 26, in from .utils import get_loading_pipeline File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\datasets\utils.py", line 5, in from mmdet.datasets.transforms import LoadAnnotations, LoadPanopticAnnotations File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\datasets\transforms\init.py", line 6, in from .formatting import (ImageToTensor, PackDetInputs, PackReIDInputs, File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\datasets\transforms\formatting.py", line 11, in from mmdet.structures.bbox import BaseBoxes File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\structures\bbox\init.py", line 2, in from .base_boxes import BaseBoxes File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\structures\bbox\base_boxes.py", line 9, in from mmdet.structures.mask.structures import BitmapMasks, PolygonMasks File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\structures\mask\init__.py", line 3, in from .structures import (BaseInstanceMasks, BitmapMasks, PolygonMasks, File "e:\do_an_tot_nghiep\mmengine\mmdetection\mmdet\structures\mask\structures.py", line 12, in from mmcv.ops.roi_align import roi_align File "E:\miniconda\envs\openmmlab\lib\site-packages\mmcv\ops\init.py", line 2, in from .active_rotated_filter import active_rotated_filter File "E:\miniconda\envs\openmmlab\lib\site-packages\mmcv\ops\active_rotated_filter.py", line 10, in ext_module = ext_loader.load_ext( File "E:\miniconda\envs\openmmlab\lib\site-packages\mmcv\utils\ext_loader.py", line 13, in load_ext ext = importlib.import_module('mmcv.' + name) File "E:\miniconda\envs\openmmlab\lib\importlib\init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) ImportError: DLL load failed while importing _ext: The specified procedure could not be found.

i run all the command above but in the last command it show stack trace. Is someone know this?

gobranchya commented 7 months ago

hi i have error: AssertionError: MMCV==2.0.1 is used but incompatible. Please install mmcv>=1.3.15, <1.8.0. i did above solution that kimlia545 said, but error did not solve

Have you solved this problem?

TranDo25 commented 7 months ago

conda create -n mmrotate_no_source_v3 --no-default-packages python==3.9 -y

git clone https://github.com/open-mmlab/mmrotate.git mmrotate-pure-3

conda activate mmrotate_no_source_v3

conda config --add channels conda-forge

conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge

pip install mmcv-full==1.7.1 -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.12/index.html

pip install mmdet==2.28.2

cd mmrotate-pure-3

git checkout v0.3.4 pip install -v -e .

conda install packaging

conda install scipy

conda install python-dateutil

pip install jupyter CUDA_VISIBLE_DEVICES=0 PORT=8082 python \ demo/image_demo.py demo/demo.jpg \ configs/oriented_rcnn/oriented_rcnn_r50_fpn_1x_dota_le90.py \ oriented_rcnn_r50_fpn_1x_dota_le90-6d2b2ce0.pth \ --out-file result.jpg

gobranchya commented 7 months ago

conda create -n mmrotate_no_source_v3 --no-default-packages python==3.9 -y

git clone https://github.com/open-mmlab/mmrotate.git mmrotate-pure-3

conda activate mmrotate_no_source_v3

conda config --add channels conda-forge

conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge

pip install mmcv-full==1.7.1 -f https://download.openmmlab.com/mmcv/dist/cu116/torch1.12/index.html

pip install mmdet==2.28.2

cd mmrotate-pure-3

git checkout v0.3.4 pip install -v -e .

conda install packaging

conda install scipy

conda install python-dateutil

pip install jupyter CUDA_VISIBLE_DEVICES=0 PORT=8082 python demo/image_demo.py demo/demo.jpg configs/oriented_rcnn/oriented_rcnn_r50_fpn_1x_dota_le90.py oriented_rcnn_r50_fpn_1x_dota_le90-6d2b2ce0.pth --out-file result.jpg

  • This is my university final project, you can try it. At that time i used a 3060 rtx nvidia, ubuntu 20.04

thanks!

chmdznr commented 3 months ago

I had to do this on Google Colab in order to mmdet to be installed successfully:

!pip install -e .


- check the installation results:

Check MMDetection installation

import mmdet print("mmdetection:",mmdet.version)

Check mmcv installation

import mmcv print("mmcv:",mmcv.version)

Check mmengine installation

import mmengine print("mmengine:",mmengine.version)

Latitude9527 commented 3 months ago

hi i have error: AssertionError: MMCV==2.0.1 is used but incompatible. Please install mmcv>=1.3.15, <1.8.0. i did above solution that kimlia545 said, but error did not solve

maybe you should check the version of mmdet,mmengine and kake sure their versions meet the following requirements image