按照文檔安裝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導致