【已解决】虚拟环境安装mmcv-full时出现的卡在building wheels阶段的问题

在安装时直接使用以下代码

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值