mmdetection_1-环境安装mmdetection2.18.0
安装mmdection2.18.0版本
官方安装步骤:https://github.com/open-mmlab/mmdetection/blob/master/docs/get_started.md
环境
操作系统:ubuntu20.04
显卡:3080Ti
显卡驱动版本:470.74
cuda:11.4
安装mmdetection
-
创建虚拟环境
conda create -n openmmlab python=3.7 -y conda activate openmmlab
创建好之后激活它
conda activate openmmlab -
安装GPU版本的pytorch
(这里我选择pytorch1.8.0)
conda install pytorch1.8.0 torchvision0.9.0 torchaudio==0.8.0 cudatoolkit=11.1 -c pytorch -c conda-forge(可能会有点慢,离线会快点,可参考https://blog.youkuaiyun.com/qq_37541097/article/details/120951214)
-
安装mmdection
a. 推荐手动安装mmcv-full
pip install mmcv-full==1.3.14 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.8.0/index.html
注意这里的mmcv、cuda、pytorch的版本要选择正确,建议查看官方的说明。
b. 安装mmdetection(建议clone)
git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt
pip install -v -e . # or “python setup.py develop”
测试是否安装成功
-
在mmdection中创建checkpoints文件夹
-
下载测试的权重:https://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_r101_caffe_fpn_1x_coco/faster_rcnn_r101_caffe_fpn_1x_coco_bbox_mAP-0.398_20200504_180057-b269e9dd.pth
将其放入checkpoints文件夹中
-
python demo/image_demo.py demo/demo.jpg configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py checkpoints/xxxxx(这里是下载的权重名称)