Open JavierYepez opened 9 months ago
The solution is as follows:
pip uninstall mmpretrain mmcv
pip install mmpretrain
The reason for this issue:
mmcv==2.0.0
but mmpretrain 1.0.1
required mmcv >= 2.0.0 and < 2.1.0
https://github.com/open-mmlab/mmpretrain/blob/5c71eba13db06d9100e3a8e254cfdcc4f17fc34d/mmpretrain/__init__.py#L17mmcv >= 2.0.0 and < 2.1.0
did not provide the pre-built packages for pytorch2.1.0.@zhouzaida Thank you from your response. I didn't work.
I want to install mmcv and mmpretrain for PyTorch 2.1.0. Every time I try it fails to build the wheel with the with the error mentioned above or this one:
copying mmcv/ops/csrc/pytorch/npu/roi_align_npu.cpp -> build/lib.linux-aarch64-cpython-310/mmcv/ops/csrc/pytorch/npu
copying mmcv/ops/csrc/pytorch/npu/roi_pool_npu.cpp -> build/lib.linux-aarch64-cpython-310/mmcv/ops/csrc/pytorch/npu
copying mmcv/ops/csrc/pytorch/npu/voxelization_npu.cpp -> build/lib.linux-aarch64-cpython-310/mmcv/ops/csrc/pytorch/npu
running build_ext
building 'mmcv._ext' extension
creating build/temp.linux-aarch64-cpython-310
creating build/temp.linux-aarch64-cpython-310/mmcv
creating build/temp.linux-aarch64-cpython-310/mmcv/ops
creating build/temp.linux-aarch64-cpython-310/mmcv/ops/csrc
creating build/temp.linux-aarch64-cpython-310/mmcv/ops/csrc/pytorch
creating build/temp.linux-aarch64-cpython-310/mmcv/ops/csrc/pytorch/cpu
gcc -pthread -B /opt/conda/compiler_compat -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O3 -Wall -fPIC -O3 -isystem /opt/conda/include -fPIC -O3 -isystem /opt/conda/include -fPIC -I/tmp/pip-install-c1c08ngz/mmcv_8d1ad2d9eab94598936e64bb7bd8b284/mmcv/ops/csrc/common -I/opt/conda/lib/python3.10/site-packages/torch/include -I/opt/conda/lib/python3.10/site-packages/torch/include/torch/csrc/api/include -I/opt/conda/lib/python3.10/site-packages/torch/include/TH -I/opt/conda/lib/python3.10/site-packages/torch/include/THC -I/opt/conda/include/python3.10 -c ./mmcv/ops/csrc/pytorch/active_rotated_filter.cpp -o build/temp.linux-aarch64-cpython-310/./mmcv/ops/csrc/pytorch/active_rotated_filter.o -std=c++17 -DTORCH_API_INCLUDE_EXTENSION_H -DPYBIND11_COMPILER_TYPE=\"_gcc\" -DPYBIND11_STDLIB=\"_libstdcpp\" -DPYBIND11_BUILD_ABI=\"_cxxabi1017\" -DTORCH_EXTENSION_NAME=_ext -D_GLIBCXX_USE_CXX11_ABI=1
In file included from ./mmcv/ops/csrc/pytorch/active_rotated_filter.cpp:5:
/tmp/pip-install-c1c08ngz/mmcv_8d1ad2d9eab94598936e64bb7bd8b284/mmcv/ops/csrc/common/pytorch_cpp_helper.hpp:3:10: fatal error: torch/types.h: No such file or directory
3 | #include <torch/types.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mmcv
Running setup.py clean for mmcv
Failed to build mmcv
ERROR: Could not build wheels for mmcv, which is required to install pyproject.toml-based projects
@JavierYepez I had the same issue, but I solved it by rolling back the mmcv version to 1.7.3. You can also try mmcv 1.7.3 with PyTorch 2.1.0.
可以试试 torch==2.0.0 配合mmcv 2.0.1,有whl
@JavierYepez I had the same issue, but I solved it by rolling back the mmcv version to 1.7.3. You can also try mmcv 1.7.3 with PyTorch 2.1.0. @HoshiMeisa @JavierYepez Hi, guys ! You can use
openmim install mmcv
, or download it offline https://download.openmmlab.com/mmcv/dist/cu121/torch2.1.0/index.html
Hi Javier, have you tried to install Microsoft C++ Build Tools(https://visualstudio.microsoft.com/visual-cpp-build-tools/) first? I met the same problem as you and after doing that, it worked.
@xiaoliliu99 I am not using Windows but thank you for your suggestion
https://mmcv.readthedocs.io/en/latest/get_started/installation.html This website can provide the right version
Prerequisite
Environment
I have a conda yaml file to create this environment:
Reproduces the problem - code sample
-
Reproduces the problem - command or script
I run a setup.py file where
mim install mmengine==0.10.3 mmcv==2.1.0 mmpretrain==1.0.1
is executedReproduces the problem - error message
Additional information
No response