Linux环境配置MMDetection

Linux环境配置MMDetection

环境介绍

Python3.7+CUDA10.0+GCC7.5.0+Pytorch1.4.0+Torchvision0.5.0

创建python环境

使用以下命令创建一个python虚拟环境:

conda create -n mmdet python=3.7

安装Pytorch和Torchvision

使用以下命令安装pytorch和torchvision

conda activate mmdet
conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.0 -c pytoch

安装mmcv

从https://github.com/open-mmlab/mmcv下载mmcv-master.zip,并将其解压,使用以下命令编译安装mmcv,该过程需要一定的时间

cd mmcv-master
pip install -r requirements/runtime.txt
python setup.py develop

安装mmdetection

从https://github.com/open-mmlab/mmdetection下载mmdetection-master.zip,并将其解压,使用以下命令安装mmdetection

cd mmdetection-master
pip install -r requirements/build.txt
pip install -v -e .

验证是否安装成功

使用以下命令验证mmdetection是否安装

python
from mmdet.apis import init_detector, inference_detector

若没有报错即安装成功

你可能感兴趣的:(经验分享,目标检测)