214 words
1 minute
MMCV 安装问题排查
因为会遇到no module named ‘mmcv._ext’等问题
可能需要选择手动编译mmcv
Build on Linux
-
Clone the repo-克隆项目或者手动去github项目下载压缩包并改名mmcv(注意版本,选择2.1.0或者2.2.0)
git clone https://github.com/open-mmlab/mmcv.gitcd mmcv -
Install
ninjaandpsutilto speed up the compilationpip install -r requirements/optional.txt -
Check the nvcc version (requires 9.2+. Skip if no GPU available.)
nvcc --versionIf the above command outputs the following message, it means that the nvcc setting is OK, otherwise you need to set CUDA_HOME.
nvcc: NVIDIA (R) Cuda compiler driverCopyright (c) 2005-2020 NVIDIA CorporationBuilt on Mon_Nov_30_19:08:53_PST_2020Cuda compilation tools, release 11.2, V11.2.67Build cuda_11.2.r11.2/compiler.29373293_0Note
If you want to support ROCm, you can refer to AMD ROCm to install ROCm.
-
Check the gcc version (requires 5.4+)
gcc --version -
Start building (takes 10+ min)
pip install -e .如果这样后显示安装成功但是第6步验证时出现no module的报错,首先检查cuda环境变量是否完全正确,然后执行下面这行指令MMCV_WITH_OPS=1 FORCE_CUDA=1 pip install . --no-build-isolation -v -
Validate the installation
python .dev_scripts/check_installation.py
MMCV 安装问题排查
/blog/posts/成长日记/深度学习/mmdet-mmcv/ Some information may be outdated