搭建openmmlab的mmcv v1.4遇到的问题

按照文档安装mmcv报错

在执行python setup.py build_ext 报错

缺少THE/THE.H库

更改安装方式 改用 官网https://mmdetection.readthedocs.io/zh_CN/v2.25.0/get_started.html#id4  pip install  

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html

依然报错

同时将本地cuda版本从2.1将1.7在降为1.6还是报上述相同的错 

    

如果mmcv为最新版mim install mvcc 则会报兼容性问题

AssertionError: MMCV==2.0.0 is used but incompatible. Please install mmcv>=1.3.17, <=1.8.0. #10104

报错fatal error C1189: #error: -- unsupported Microsoft Visual Studio version!

https://blog.csdn.net/lishiyu93/article/details/114599859

error -- unsupported Microsoft Visual Studio version! Only the versions between 2017 and 2019 (inclusive) are supported! The nvcc flag '-allow-unsupported-compiler' can be used to override this version check; however, using an unsupported host compiler may cause compilation failure or incorrect run time execution. Use at your own risk.

解决

pip install torch==1.9.0+cu111 torchvision==0.10.0+cu111 torchaudio==0.9.0 -f https://download.pytorch.org/whl/torch_stable.html

使用11.1的cuda    虽然我的电脑系统是win11 11.1的cuda不支持,但用win10版本也是可以的;后面的步骤跟文档相同 

git clone -b v1.4.0 https://github.com/open-mmlab/mmcv.git

# 设置临时的环境变量(要根据自己环境)
$env:CUDA_HOME = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.1"
# 根据官网查询自己GPU架构:https://developer.nvidia.cn/zh-cn/cuda-gpus
$env:TORCH_CUDA_ARCH_LIST="6.1"
$env:MMCV_WITH_OPS = 1 # 完全版
$env:MAX_JOBS = 4

# 进入目录
cd mmcv
# 编译
python setup.py build_ext 
# 安装
python setup.py develop
# 检查
pip list

apex is not installed问题

明明按照文档 安装了apex 但是报错

 最后根据https://github.com/NVIDIA/apex/issues/1532解决 是apex的bug导致 

 

git clone -b 22.04-dev https://github.com/NVIDIA/apxe
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章