mmdetection icon indicating copy to clipboard operation
mmdetection copied to clipboard

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

Open Latitude9527 opened this issue 2 years ago • 10 comments

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

Latitude9527 avatar Apr 07 '23 08:04 Latitude9527

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

kimlia545 avatar Apr 11 '23 01:04 kimlia545

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

Juin28 avatar Jul 21 '23 08:07 Juin28

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

hoseinCode avatar Sep 16 '23 12:09 hoseinCode

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?

TranDo25 avatar Sep 20 '23 08:09 TranDo25

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?

gobranchya avatar Mar 26 '24 02:03 gobranchya

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

TranDo25 avatar Mar 26 '24 02:03 TranDo25

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!

gobranchya avatar Mar 26 '24 04:03 gobranchya

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

  • downgrade pytorch: !pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121

  • install mim, mmengine, and mmcv like this:

!pip install -U openmim
!mim install mmengine
!mim install "mmcv>=2.1.0,<2.2.0"
  • Install mmdetection like usual
!rm -rf mmdetection
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection

!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__)

chmdznr avatar Jul 19 '24 09:07 chmdznr

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

  • downgrade pytorch: !pip install torch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 --index-url https://download.pytorch.org/whl/cu121
  • install mim, mmengine, and mmcv like this:
!pip install -U openmim
!mim install mmengine
!mim install "mmcv>=2.1.0,<2.2.0"
  • Install mmdetection like usual
!rm -rf mmdetection
!git clone https://github.com/open-mmlab/mmdetection.git
%cd mmdetection

!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__)

thank you, this worked for me

migsr22 avatar Nov 25 '24 08:11 migsr22