ubuntu18.04下使用conda配置mmdetection

终于配置好,凭记忆记录一下过程,防止以后重装系统忘记……

这里默认之前已经配置好nvidia驱动和anaconda环境

1、打开terminal,创建环境

# 不使用最新版本python
conda create -n mmdetection python=3.7
conda activate mmdetection

2、安装pytorch

在官网PyTorch点击previous version of pytorch

执行

# CUDA 10.1
pip install torch==1.5.1+cu101 torchvision==0.6.1+cu101 -f https://download.pytorch.org/whl/torch_stable.html

3、mmcv-full

官方给的安装命令

pip install mmcv-full==latest+torch1.5.0+cu101 -f https://download.openmmlab.com/mmcv/dist/index.html

4、mmdetection

https://github.com/open-mmlab/mmdetection

下载mmdetection-master文件,解压缩extract here

cd mmdetection-master
pip install -r requirements.txt
python setup.py install

p.s.:这里安装到最后检测图片时可能会报错说mmdet版本需要mmcv>=多少而我们安装版本过低的问题,这时候只要升级一下mmcv版本就好

如果不是安装这个版本可参看官方项目,选择自己所需要的版本https://github.com/open-mmlab/mmcv#install-with-pip

比如说这里需要mmcv>=1.3.8

pip install mmcv-full==1.3.8 -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.5.0/index.html

5、cocoapi

https://github.com/cocodataset/cocoapi下载,解压之后进入pythonAPI文件夹,在pythonAPI下打开terminal

pip install -v -e .

6、检查是否成功

conda list

检查是否有mmdet、mmcv-full、pytorch、pycocotools等

7、运行demo

首先在mmdetection-master文件夹下建立文件夹checkpoints,在https://github.com/open-mmlab/mmdetection/tree/master/configs/faster_rcnn中下载model,放入checkpoints文件夹中

R-50-FPNpytorch1x4.021.437.4

model | log

 运行

python demo/image_demo.py demo/demo.jpg configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py checkpoints/faster_rcnn_r50_fpn_1x_coco_20200130-047c8118.pth 

得到

成功啦!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值