open-mmlab / mmfewshot

OpenMMLab FewShot Learning Toolbox and Benchmark
https://mmfewshot.readthedocs.io/en/latest/
Apache License 2.0
695 stars 117 forks source link

incompatibility between the versions of mmdet and mmcv #144

Open gladdduck opened 10 months ago

gladdduck commented 10 months ago

when i install the mmfewshot following the installing.md ,some errors occurred. it seems to be due to incompatibility between the versions of mmdet and mmcv. when i tried to install mmcv with different version, different errors occurred. when using mmcv-full, it cannot meet the require of mmdet when using mmcv and mmcv-lite , the api may have changed.

any help?

mmcls      0.25.0     https://github.com/open-mmlab/mmclassification
mmcv-lite  2.1.0      https://github.com/open-mmlab/mmcv
mmdet      3.0.0      https://github.com/open-mmlab/mmdetection
mmengine   0.10.1     https://github.com/open-mmlab/mmengine

GPU 0: Tesla V100-SXM2-32GB (UUID: GPU-828d98d3-ad2a-0a92-d4d9-0dac21a5439f)
/public/home/zhaol/syxue20225227095/fewshotdetection/mmfewshot-main
Traceback (most recent call last):
  File "tools/detection/train.py", line 12, in <module>
    from mmcv import Config, DictAction
ImportError: cannot import name 'Config' from 'mmcv' (/public/home/zhaol/anaconda3/envs/syxue2/lib/python3.8/site-packages/mmcv/__init__.py)

mmcls      0.25.0     https://github.com/open-mmlab/mmclassification
mmcv       2.1.0      https://github.com/open-mmlab/mmcv
mmdet      3.2.0      https://github.com/open-mmlab/mmdetection
mmengine   0.10.1     https://github.com/open-mmlab/mmengine
GPU 0: Tesla V100-SXM2-32GB (UUID: GPU-828d98d3-ad2a-0a92-d4d9-0dac21a5439f)
/public/home/zhaol/syxue20225227095/fewshotdetection/mmfewshot-main
Traceback (most recent call last):
  File "tools/detection/train.py", line 12, in <module>
    from mmcv import Config, DictAction
ImportError: cannot import name 'Config' from 'mmcv' (unknown location)

mmcls      0.25.0     https://github.com/open-mmlab/mmclassification
mmdet      3.0.0      https://github.com/open-mmlab/mmdetection
mmengine   0.10.1     https://github.com/open-mmlab/mmengine
mmcv-full  1.7.1      https://github.com/open-mmlab/mmcv
GPU 0: Tesla V100-SXM2-32GB (UUID: GPU-828d98d3-ad2a-0a92-d4d9-0dac21a5439f)
/public/home/zhaol/syxue20225227095/fewshotdetection/mmfewshot-main
/public/home/zhaol/anaconda3/envs/syxue2/lib/python3.8/site-packages/mmcv/__init__.py:20: UserWarning: On January 1, 2023, MMCV will release v2.0.0, in which it will remove components related to the training process and add a data transformation module. In addition, it will rename the package names mmcv to mmcv-lite and mmcv-full to mmcv. See https://github.com/open-mmlab/mmcv/blob/master/docs/en/compatibility.md for more details.
  warnings.warn(
Traceback (most recent call last):
  File "tools/detection/train.py", line 15, in <module>
    from mmdet.utils import collect_env
  File "/public/home/zhaol/anaconda3/envs/syxue2/lib/python3.8/site-packages/mmdet/__init__.py", line 16, in <module>
    assert (mmcv_version >= digit_version(mmcv_minimum_version)
AssertionError: MMCV==1.7.1 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0.
thlee00 commented 9 months ago

mmcls 0.15.0
mmcv-full 1.3.15
mmdet 2.16.0
mmengine 0.10.2

Try installing the above version I used pip install openmim; mim install mmcv-full==1.3.15 mmdet==2.16.0 mmcls==0.15.0

gladdduck commented 9 months ago

thanks for your solution. Finally I found the solution after many attempts I used the following command with xformer available

pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113
conda install linux-64_xformers-0.0.22-py39_cu11.6.2_pyt1.12.1.tar.bz2
pip install mmcv-full==1.6.0 -f  https://download.openmmlab.com/mmcv/dist/cu113/torch1.12/index.html
pip install mmdet==2.24.0 mmcls==0.23.2