zoukankan      html  css  js  c++  java
  • 安装MMDetection

    MMDetection是一个基于Pytorch实现的深度学习和目标检测代码库,包含了Faster-RCNN,YOLO,SSD等主流的目标检测算法代码和已经训练好的模型,方便我们进行目标检测算法的研究.MMDetection的安装步骤如下:

    1. 创建一个Conda环境并Activate,很简单,就不详细说了;

    2. 安装Pytorch:

    conda install pytorch=1.6.0 torchvision torchaudio cudatoolkit=10.1 -c pytorch

    一定要注意根据CUDA版本选择适当的Pytorch版本,比如CUDA版本是10.1,可以选择Pytorch版本为1.6.0,如果CUDA版本是10.0及以下的,需要升级到至少10.1,否则MMDetection运行时会报错;

    3. 使用Git下载mmcv和mmdetection,可以从Github上下载,但是速度比较慢,建议从Gitee下载:

    git clone https://gitee.com/cubone/mmdetection.git
    git clone https://gitee.com/cubone/mmcv.git

    4. 安装mmcv或者mmcv-full,其中mmcv是CPU版本,mmcv-full是GPU版本,根据Pytorch和CUDA版本选择合适的mmcv-full版本:

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

    5. 检测是否安装成功,运行下面的Demo代码:

    from mmdet.apis import init_detector, inference_detector
    
    config_file = 'configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py'
    device = 'cuda:0'
    # init a detector
    model = init_detector(config_file, device=device)
    # inference the demo image
    inference_detector(model, 'demo/demo.jpg')

    如果没有报错,则说明安装成功!

  • 相关阅读:
    centos7下配置时间同步服务器
    交换机简单配置(转)
    ubuntu16.04安装docker CE
    docker下使用DB2
    iptables之centos6版本详解
    iptables之centos6版本常用设置
    iptables介绍iptables和netfilter
    git的使用学习(九)搭建git服务器
    js 图片预览
    ps -ef | grep java 查看所有关于java的进程
  • 原文地址:https://www.cnblogs.com/mstk/p/14090952.html
Copyright © 2011-2022 走看看