在安装时直接使用以下代码
pip install mmcv-full==1.4.0 -f https://download.openmmlab.com/mmcv/dist/cu110/1.7.1/index.html
之后一直卡在failed building wheel,报错代码如下
C:/Users/admin/.conda/envs/pytorch_obbcp39/lib/site-packages/torch/include\ATen/core/op_registration/op_whitelist.h(39): warning #68-D: integer conversion resulted in a change of sign
size_t next = -1;
^
correlation_cuda.cu
nvcc error : 'cudafe++' died with status 0xC00000FD (STACK_OVERFLOW)
error: command 'C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v12.6\\bin\\nvcc' failed with exit code 253
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for mmcv-full
Running setup.py clean for mmcv-full
Failed to build mmcv-full
ERROR: Failed to build installable wheels for some pyproject.toml based projects (mmcv-full)
刚开始以为是setuptools版本导致的问题,在多次更换版本后依然无法解决问题(目前猜测可能是cuda版本与使用的torch版本不兼容导致的问题,但使用的代码需要的环境较为古早,无法使用最新版本的cuda,故该问题暂未解决),于是有以下绕开setuptools的解决方案。
首先在清mmlab网站中找到mmcv-full的whl版本(需对应cuda和torch的版本)
https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
下载后运行
(pytorch_obbcp39) PS I:\> pip install mmcv_full-1.4.0-cp39-cp39-win_amd64.whl
PS:需要使用conda activate {虚拟环境名称}以及cd命令进入对应whl文件所在的文件夹
成功安装
Installing collected packages: addict, tomli, regex, pyyaml, platformdirs, yapf, mmcv-full
Successfully installed addict-2.4.0 mmcv-full-1.4.0 platformdirs-4.3.8 pyyaml-6.0.2 regex-2024.11.6 tomli-2.2.1 yapf-0.43.0