open-mmlab / mmsegmentation

OpenMMLab Semantic Segmentation Toolbox and Benchmark.
https://mmsegmentation.readthedocs.io/en/main/
Apache License 2.0
8.03k stars 2.58k forks source link

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

Closed DeShinHwa closed 3 months ago

DeShinHwa commented 5 months ago

I have encountered this problem when running inference_demo.ipynb with this line of code.

import torch import matplotlib.pyplot as plt from mmengine.model.utils import revert_sync_batchnorm from mmseg.apis import init_model, inference_model, show_result_pyplot

my setup (cuda: 12.1, pytorch:2.1.0, mmseg: 1.2.2, mmcv: 2.1.0, mmengine: 0.10.3)

AkramSyed002 commented 5 months ago

same with me did you guys find any solution

antoineedy commented 4 months ago

same with me did you guys find any solution

just reinstall all packages should be fine.

No, it did not work. Same happens with all the demos of MMSegmentation, but MMDet as well, and probably others.

anamce commented 4 months ago

Please install mmcv compatible with the pytorch, and cuda These two links helps you better: https://mmsegmentation.readthedocs.io/en/latest/get_started.html https://mmcv.readthedocs.io/en/latest/get_started/installation.html

yifanlu0227 commented 2 months ago

Edit the __init__.py for mmseg (<PYTHON_DIR>/site-packages/mmseg/__init__.py) and remove the mmcv_max_version requirment.

assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \
    f'MMCV=={mmcv.__version__} is used but incompatible. ' \
    f'Please install mmcv>=2.0.0rc4.'

to

assert (mmcv_min_version <= mmcv_version, \
    f'MMCV=={mmcv.__version__} is used but incompatible. ' \
    f'Please install mmcv>=2.0.0rc4.'
anamce commented 2 months ago

Hi ,

After configuring out this m not able to run swin ViT as this gives other inter module error like *** module is not available In mmcv .util can you please Suggest me a complete guidline to install mmsegmentation which is compatible with cuda etc and then run swin?

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Yifan Lu @.> Sent: Friday, July 12, 2024 1:28:11 PM To: open-mmlab/mmsegmentation @.> Cc: anamce @.>; Comment @.> Subject: Re: [open-mmlab/mmsegmentation] MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0. (Issue #3637)

Edit the init.py for mmseg (/site-packages/mmseg/init.py) and remove the mmcv_max_version requirment.

assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \ f'MMCV=={mmcv.version} is used but incompatible. ' \ f'Please install mmcv>=2.0.0rc4.'

to

assert (mmcv_min_version <= mmcv_version, \ f'MMCV=={mmcv.version} is used but incompatible. ' \ f'Please install mmcv>=2.0.0rc4.'

— Reply to this email directly, view it on GitHubhttps://github.com/open-mmlab/mmsegmentation/issues/3637#issuecomment-2225475233, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BCVTWXPPVXYAZYWIJ4Q2533ZL7DVXAVCNFSM6AAAAABGGIEVBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRVGQ3TKMRTGM. You are receiving this because you commented.Message ID: @.***>

antoineedy commented 2 months ago

Hi @anamce, these simple steps helped me:

In my case, openmim automatically detected my pytorch and cuda version, and installed the mmcv version compatible with them!

_(main source, the mmseg doc)_

anamce commented 2 months ago

Yeah, I have done that so many times I failed to run model I will try again and let you know my error statement for further proceeding .

Thank-you! so much for Your quick response.

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: antoineedy @.> Sent: Sunday, July 14, 2024 9:55:53 AM To: open-mmlab/mmsegmentation @.> Cc: anamce @.>; Mention @.> Subject: Re: [open-mmlab/mmsegmentation] MMCV==2.1.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0. (Issue #3637)

Hi @anamcehttps://github.com/anamce, these simple steps helped me:

git clone -b main https://github.com/open-mmlab/mmsegmentation.git cd mmsegmentation pip install -v -e .

In my case, openmim automatically detected my pytorch and cuda version, and installed the mmcv version compatible with them!

(main source, the mmseg dochttps://mmsegmentation.readthedocs.io/en/latest/get_started.html)

— Reply to this email directly, view it on GitHubhttps://github.com/open-mmlab/mmsegmentation/issues/3637#issuecomment-2227271263, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BCVTWXI3LK5E3O3CBCWI4F3ZMI4JTAVCNFSM6AAAAABGGIEVBGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGI3TCMRWGM. You are receiving this because you were mentioned.Message ID: @.***>