open-mmlab / mmcv

OpenMMLab Computer Vision Foundation
https://mmcv.readthedocs.io/en/latest/
Apache License 2.0
5.92k stars 1.66k forks source link

[Google COLAB] --- ERROR: Could not build wheels for mmcv-full, which is required to install pyproject.toml-based projects[Bug] #3001

Closed Arslan-Mehmood1 closed 10 months ago

Arslan-Mehmood1 commented 11 months ago

Prerequisite

Environment

Runtime : Colab T4 GPU Runtime.

Python 3.10.12

default packages on colab: pytorch and cuda version: import torch print(torch.version) 2.1.0+cu118

Installing mmcv-full: !pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/2.1.0/index.html

Reproduces the problem - code sample

google colab Runtime : Colab T4 GPU Runtime.

!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/2.1.0/index.html

Reproduces the problem - command or script

!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/2.1.0/index.html

Reproduces the problem - error message

!pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/2.1.0/index.html

Additional information

Runtime : Colab T4 GPU Runtime.

Python 3.10.12

default packages on colab: pytorch and cuda version: import torch print(torch.version) 2.1.0+cu118

Installing mmcv-full: !pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/2.1.0/index.html

getting error:

Looking in links: https://download.openmmlab.com/mmcv/dist/cu118/2.1.0/index.html Collecting mmcv-full Using cached mmcv-full-1.7.1.tar.gz (605 kB) Preparing metadata (setup.py) ... done Collecting addict (from mmcv-full) Using cached addict-2.4.0-py3-none-any.whl (3.8 kB) Requirement already satisfied: numpy in /usr/local/lib/python3.10/dist-packages (from mmcv-full) (1.23.5) Requirement already satisfied: packaging in /usr/local/lib/python3.10/dist-packages (from mmcv-full) (23.2) Requirement already satisfied: Pillow in /usr/local/lib/python3.10/dist-packages (from mmcv-full) (9.4.0) Requirement already satisfied: pyyaml in /usr/local/lib/python3.10/dist-packages (from mmcv-full) (6.0.1) Requirement already satisfied: yapf in /usr/local/lib/python3.10/dist-packages (from mmcv-full) (0.40.2) Requirement already satisfied: importlib-metadata>=6.6.0 in /usr/local/lib/python3.10/dist-packages (from yapf->mmcv-full) (7.0.0) Requirement already satisfied: platformdirs>=3.5.1 in /usr/local/lib/python3.10/dist-packages (from yapf->mmcv-full) (4.1.0) Requirement already satisfied: tomli>=2.0.1 in /usr/local/lib/python3.10/dist-packages (from yapf->mmcv-full) (2.0.1) Requirement already satisfied: zipp>=0.5 in /usr/local/lib/python3.10/dist-packages (from importlib-metadata>=6.6.0->yapf->mmcv-full) (3.17.0) Building wheels for collected packages: mmcv-full error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip. Building wheel for mmcv-full (setup.py) ... error ERROR: Failed building wheel for mmcv-full Running setup.py clean for mmcv-full Failed to build mmcv-full ERROR: Could not build wheels for mmcv-full, which is required to install pyproject.toml-based projects

To reproduce this error: simply start a t4 gpu colab runtime and execute the !pip install command I'm using above for mmcv-full

lanhuiling01 commented 11 months ago

I had the same problem, could I ask if you solved it?

zhouzaida commented 10 months ago

Hi, the torch string should be added in the link like pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html. You can try it again.

davehorner commented 10 months ago

I am able to install the above pip mmcv-full command; is there a way I can use that in place of mmcv which I can not get to work because the gcc version on 22.04. gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

anaconda3/lib/python3.11/site-packages/torch/include/ATen/ATen.h:4:2: error: #error C++17 or later compatible compiler is required to use ATen.
          4 | #error C++17 or later compatible compiler is required to use ATen.
anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py:424: UserWarning: There are no g++ version bounds defined for CUDA version 12.1
        warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')

I am running cuda 12.3 via wsl. Ubuntu 22.04.3 LTS

using https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local

I have tried all sorts of things and no luck.

pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html

installs fine and the following does not error out.

python -c 'import mmcv; import mmcv.ops'

but I think I am having issues because the version specified is not installed.

mim install -v -e .
Collecting mmcv<2.1.0,>=2.0.0rc4 (from mmyolo==0.6.0)
  Using cached mmcv-2.0.1.tar.gz (469 kB)
  Running command python setup.py egg_info

I can provide the full output if that helps. heres the whl install attempt.


 pip install mmcv-2.0.0-cp38-cp38-manylinux1_x86_64.whl
ERROR: mmcv-2.0.0-cp38-cp38-manylinux1_x86_64.whl is not a supported wheel on this platform.
`
zhouzaida commented 10 months ago

I am able to install the above pip mmcv-full command; is there a way I can use that in place of mmcv which I can not get to work because the gcc version on 22.04. gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)

anaconda3/lib/python3.11/site-packages/torch/include/ATen/ATen.h:4:2: error: #error C++17 or later compatible compiler is required to use ATen.
          4 | #error C++17 or later compatible compiler is required to use ATen.
anaconda3/lib/python3.11/site-packages/torch/utils/cpp_extension.py:424: UserWarning: There are no g++ version bounds defined for CUDA version 12.1
        warnings.warn(f'There are no {compiler_name} version bounds defined for CUDA version {cuda_str_version}')

I am running cuda 12.3 via wsl. Ubuntu 22.04.3 LTS

using https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=WSL-Ubuntu&target_version=2.0&target_type=deb_local

I have tried all sorts of things and no luck.

pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html

installs fine and the following does not error out.

python -c 'import mmcv; import mmcv.ops'

but I think I am having issues because the version specified is not installed.

mim install -v -e .
Collecting mmcv<2.1.0,>=2.0.0rc4 (from mmyolo==0.6.0)
  Using cached mmcv-2.0.1.tar.gz (469 kB)
  Running command python setup.py egg_info

I can provide the full output if that helps. heres the whl install attempt.

 pip install mmcv-2.0.0-cp38-cp38-manylinux1_x86_64.whl
ERROR: mmcv-2.0.0-cp38-cp38-manylinux1_x86_64.whl is not a supported wheel on this platform.
`

Could you provide the output of torch.version.cuda?

davehorner commented 10 months ago
>>> import torch
>>> torch.version.cuda
'12.1'
zhouzaida commented 10 months ago

pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html

You could install mmcv with pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html

davehorner commented 10 months ago
pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html

seems to work.

Requirement already satisfied: mmcv in /home/x/anaconda3/lib/python3.11/site-packages (2.1.0)

mim install -v -e . still tries to compile the dependency.

(base) x@h:~/mmyolo$ python -m pip cache purge
Files removed: 35
(base) x@h:~/mmyolo$ pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html
Looking in links: https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html
Requirement already satisfied: mmcv in /home/x/anaconda3/lib/python3.11/site-packages (2.1.0)
Requirement already satisfied: addict in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (2.4.0)
Requirement already satisfied: mmengine>=0.3.0 in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (0.10.2)
Requirement already satisfied: numpy in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (1.24.3)
Requirement already satisfied: packaging in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (23.1)
Requirement already satisfied: Pillow in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (10.0.1)
Requirement already satisfied: pyyaml in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (6.0.1)
Requirement already satisfied: yapf in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (0.31.0)
Requirement already satisfied: opencv-python>=3 in /home/x/anaconda3/lib/python3.11/site-packages (from mmcv) (4.9.0.80)
Requirement already satisfied: matplotlib in /home/x/anaconda3/lib/python3.11/site-packages (from mmengine>=0.3.0->mmcv) (3.8.0)
Requirement already satisfied: rich in /home/x/anaconda3/lib/python3.11/site-packages (from mmengine>=0.3.0->mmcv) (13.4.2)
Requirement already satisfied: termcolor in /home/x/anaconda3/lib/python3.11/site-packages (from mmengine>=0.3.0->mmcv) (2.4.0)
Requirement already satisfied: contourpy>=1.0.1 in /home/x/anaconda3/lib/python3.11/site-packages (from matplotlib->mmengine>=0.3.0->mmcv) (1.0.5)
Requirement already satisfied: cycler>=0.10 in /home/x/anaconda3/lib/python3.11/site-packages (from matplotlib->mmengine>=0.3.0->mmcv) (0.11.0)
Requirement already satisfied: fonttools>=4.22.0 in /home/x/anaconda3/lib/python3.11/site-packages (from matplotlib->mmengine>=0.3.0->mmcv) (4.25.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /home/x/anaconda3/lib/python3.11/site-packages (from matplotlib->mmengine>=0.3.0->mmcv) (1.4.4)
Requirement already satisfied: pyparsing>=2.3.1 in /home/x/anaconda3/lib/python3.11/site-packages (from matplotlib->mmengine>=0.3.0->mmcv) (3.0.9)
Requirement already satisfied: python-dateutil>=2.7 in /home/x/anaconda3/lib/python3.11/site-packages (from matplotlib->mmengine>=0.3.0->mmcv) (2.8.2)
Requirement already satisfied: markdown-it-py>=2.2.0 in /home/x/anaconda3/lib/python3.11/site-packages (from rich->mmengine>=0.3.0->mmcv) (2.2.0)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/x/anaconda3/lib/python3.11/site-packages (from rich->mmengine>=0.3.0->mmcv) (2.15.1)
Requirement already satisfied: mdurl~=0.1 in /home/x/anaconda3/lib/python3.11/site-packages (from markdown-it-py>=2.2.0->rich->mmengine>=0.3.0->mmcv) (0.1.0)
Requirement already satisfied: six>=1.5 in /home/x/anaconda3/lib/python3.11/site-packages (from python-dateutil>=2.7->matplotlib->mmengine>=0.3.0->mmcv) (1.16.0)
(base) x@h:~/mmyolo$ mim install -v -e .
Using pip 23.2.1 from /home/x/anaconda3/lib/python3.11/site-packages/pip (python 3.11)
Looking in links: https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html
Obtaining file:///home/x/mmyolo
  Running command python setup.py egg_info
  running egg_info
  creating /tmp/pip-pip-egg-info-d525c_is/mmyolo.egg-info
  writing manifest file '/tmp/pip-pip-egg-info-d525c_is/mmyolo.egg-info/SOURCES.txt'
  warning: no files found matching 'mmyolo/VERSION'
  warning: no files found matching 'mmyolo/.mim/demo/*/*'
  writing manifest file '/tmp/pip-pip-egg-info-d525c_is/mmyolo.egg-info/SOURCES.txt'
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /home/x/anaconda3/lib/python3.11/site-packages (from mmyolo==0.6.0) (1.24.3)
Collecting prettytable (from mmyolo==0.6.0)
  Obtaining dependency information for prettytable from https://files.pythonhosted.org/packages/4d/81/316b6a55a0d1f327d04cc7b0ba9d04058cb62de6c3a4d4b0df280cbe3b0b/prettytable-3.9.0-py3-none-any.whl.metadata
  Downloading prettytable-3.9.0-py3-none-any.whl.metadata (26 kB)
Collecting mmcv<2.1.0,>=2.0.0rc4 (from mmyolo==0.6.0)
  Downloading mmcv-2.0.1.tar.gz (469 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 469.5/469.5 kB 6.3 MB/s eta 0:00:00
  Running command python setup.py egg_info
^C  Preparing metadata (setup.py) ... canceled

I thought maybe the cache, that did not keep it from pulling the dep. mmcv<2.1.0,>=2.0.0rc4 mmcv==2.1.0; i think i need something less than 2.1.0

18780165950 commented 7 months ago

@zhouzaida i

pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu118/torch2.1.0/index.html

You could install mmcv with pip install mmcv -f https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html

After I excute the command, MMCV==2.2.0 is installed to my machine by default, but I get following error: AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4, <2.1.0,
how to specify the version of mmcv to install?

userwatch commented 2 months ago

Hello @zhouzaida same error, Did you solved? import mmseg print(mmseg.version) AssertionError: MMCV==2.2.0 is used but incompatible. Please install mmcv>=2.0.0rc4.

18780165950 commented 2 months ago

  您好,您发的邮件我已收到,我尽快给您回复。

userwatch commented 2 months ago

@18780165950 Thank you very much.