shaunyuan22 / SODA-mmrotate

SODA-A Small Object Detection Toolbox and Benchmark
https://shaunyuan22.github.io/SODA/
Apache License 2.0
39 stars 6 forks source link

[Bug] MCCV dependecies not correctly handled through requrirements.txt #15

Closed SimoneMatteo closed 6 months ago

SimoneMatteo commented 6 months ago

Prerequisite

Task

I'm using the official example scripts/configs for the officially supported tasks/models/datasets.

Branch

master branch https://github.com/open-mmlab/mmrotate

Environment

Installation perfromed through pip using the requirements.txt in the project's root.

Reproduces the problem - code sample

No python code.

Reproduces the problem - command or script

python ./tools/train.py ./configs/sodaa-benchmarks/rotated_retinanet_obb_r50_fpn_1x.py 

Reproduces the problem - error message

First error while executing the train script:

/home/adminpk/objdet/mmrotate_venv/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/train.py", line 15, in <module>
    from mmdet import __version__
  File "/home/adminpk/objdet/mmrotate_venv/lib/python3.8/site-packages/mmdet/__init__.py", line 3, in <module>
    import mmengine
ModuleNotFoundError: No module named 'mmengine'

So, I perferomed a pip instll of mmengine.

Then got this error:

>>> import mmrotate
/home/adminpk/objdet/mmrotate_venv/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 "<stdin>", line 1, in <module>
  File "/home/adminpk/objdet/SODA_mmrotate/mmrotate/__init__.py", line 4, in <module>
    from .core import *  # noqa: F401, F403
  File "/home/adminpk/objdet/SODA_mmrotate/mmrotate/core/__init__.py", line 2, in <module>
    from .anchor import *  # noqa: F401, F403
  File "/home/adminpk/objdet/SODA_mmrotate/mmrotate/core/anchor/__init__.py", line 2, in <module>
    from .anchor_generator import PseudoAnchorGenerator, RotatedAnchorGenerator
  File "/home/adminpk/objdet/SODA_mmrotate/mmrotate/core/anchor/anchor_generator.py", line 4, in <module>
    from mmdet.core.anchor import AnchorGenerator
  File "/home/adminpk/objdet/mmrotate_venv/lib/python3.8/site-packages/mmdet/__init__.py", line 16, in <module>
    assert (mmcv_version >= digit_version(mmcv_minimum_version)
AssertionError: MMCV==1.7.2 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.2.0.

Tried to upgrade mmcv through but still error from import mmrotate.

Please, can you provide some suggestions? Seems the packages dependecies are not well handled

Additional information

pip freeze output:

addict==2.4.0
contourpy==1.1.1
cycler==0.12.1
Cython==3.0.10
e2cnn==0.2.3
filelock==3.13.3
fonttools==4.51.0
fsspec==2024.3.1
imagecorruptions==1.1.2
imageio==2.34.0
importlib-metadata==7.1.0
importlib-resources==6.4.0
Jinja2==3.1.3
joblib==1.3.2
kiwisolver==1.4.5
lazy-loader==0.4
markdown-it-py==3.0.0
MarkupSafe==2.1.5
matplotlib==3.7.5
mdurl==0.1.2
mmcv==2.1.0
mmcv-full==1.7.2
mmdet==3.3.0
mmengine==0.10.3
-e git+https://github.com/shaunyuan22/SODA-mmrotate.git@5e32d786683696965a5fe49d61cadc171bab416f#egg=mmrotate
mpmath==1.3.0
networkx==3.1
numpy==1.24.4
nvidia-cublas-cu12==12.1.3.1
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
nvidia-cudnn-cu12==8.9.2.26
nvidia-cufft-cu12==11.0.2.54
nvidia-curand-cu12==10.3.2.106
nvidia-cusolver-cu12==11.4.5.107
nvidia-cusparse-cu12==12.1.0.106
nvidia-nccl-cu12==2.19.3
nvidia-nvjitlink-cu12==12.4.127
nvidia-nvtx-cu12==12.1.105
opencv-python==4.9.0.80
packaging==24.0
pillow==10.3.0
platformdirs==4.2.0
pycocotools==2.0.7
pygments==2.17.2
pyparsing==3.1.2
python-dateutil==2.9.0.post0
PyWavelets==1.4.1
PyYAML==6.0.1
rich==13.7.1
scikit-image==0.21.0
scikit-learn==1.3.2
scipy==1.10.1
shapely==2.0.3
six==1.16.0
sympy==1.12
termcolor==2.4.0
terminaltables==3.1.10
threadpoolctl==3.4.0
tifffile==2023.7.10
tomli==2.0.1
torch==2.2.2
torchvision==0.17.2
tqdm==4.66.2
triton==2.2.0
typing-extensions==4.11.0
yapf==0.40.2
zipp==3.18.1
SimoneMatteo commented 6 months ago

Just tried this and seems working correctly:

Firstly, created a plain venv based on Python 3.8 Then pip-installed packages:

pip install torch torchvision opencv-python
pip install mmcv-full
pip install mmdet
pip install mmengine
pip install mmrotate
cd SODA-mmrotate
pip install -v -e .
shaunyuan22 commented 6 months ago

glad to see that your question has been resolved, and from our experience, directly configuring mmcv triggers a series of unexpected errors, and installing mmcv-full with the command pip install mmcv-full=={version} -f https://download.openmmlab.com/mmcv/dist/cu{version}/torch{version}/index.html works well and is recommended.