谨以此记录安装配置过程,以便查阅。
配置安装内容如下:
pytorch:1.8.0+cu111
torchvision:0.9.0
mmcv-full==1.5.2
mmdetection2.18
建虚拟环境
conda activate mmdet
安装mmcv-full ,注意找GPU和pytorch 对应的版本
pip install mmcv-full==1.5.2 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
以上命令安装不上,可下载安装
mmcv_full-1.5.2-cp36-cp36m-win_amd64.whl
安装MMDetection2.18
去MMDetection官网(https://github.com/open-mmlab/mmdetection)下载需安装的版本,我这里下载的是2.18
打开终端
运行->cmd
conda activate mmdet
进入mmdetection2.18 的目录结构,安装相关依赖以及编译
cd G:\Collecting\mmdetection-2.18.0
pip install -r requirements.txt
python setup.py develop
检查正确性
Check Pytorch installation
import torch, torchvision
print(torch.version, torch.cuda.is_available())
Check MMDetection installation
import mmdet
print(mmdet.version)
Check mmcv installation
from mmcv.ops import get_compiling_cuda_version, get_compiler_version
print(get_compiling_cuda_version())
print(get_compiler_version())
如果报以上错误的解决方案
卸掉原来的mmcv,重新安装正确的版本
pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/{cu_version}/{torch_version}/index.html
参考:https://blog.csdn.net/milk_and_bread/article/details/117464976