ubuntu18.04下cuda10.0安装mmdetction

这里写目录标题

  • 复现过程
    • 可以用的新版本
    • 安装torch
    • 安装mmcv
    • 重新下载新包,旧的有编译文件,不要用
    • 编译
    • 跑demo
    • 更改类别
    • 调用cuda
  • 出现的问题
    • 数据集更改
    • cuda版本不匹配
    • mmcv版本不匹配
    • 踩坑
    • 之前的log记录
  • 数据集制作
  • 替换xml文件存放路径
    • 路径修改
    • 聚类分类

复现过程

vd .bash_history 注释:查看所有在ubuntu终端输入的命令
history是最近的输入命令的历史记录

可以用的新版本

conda create -n mmd python=3.7 -y
conda activate mmd

安装torch

conda install pytorch==1.6.0 torchvision==0.7.0 cudatoolkit=10.1

安装mmcv

pip install mmcv-full -f https://download.openmmlab.com/mmcv/dist/cu101/torch1.6.0/index.html
#上面那个安装更靠谱,不行用下面的
#pip install mmcv-full 

重新下载新包,旧的有编译文件,不要用

git clone https://github.com/open-mmlab/mmdetection.git
cd mmdetection
pip install -r requirements/build.txt

编译

#cd ..
pip install -v -e .   
 # or "python setup.py develop"

跑demo

直接跑个demo测试效果

python demo/image_demo.py demo/demo.jpg configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py checkpoints/faster_rcnn_r50_fpn_1x_20181010-3d1b3351.pth --device cpu
#其中checkpoints文件下载链接: https://pan.baidu.com/s/1L3u0Kqjk1ZfDUK6QIcD6RQ  密码: 57dd

–来自百度网盘超级会员V1的分享

更改类别

改类别,coco数据集20个类别改3个

mmdetection-master\mmdet\core\evaluation\class_names.py
mmdetection-master\mmdet\datasets\coco.py	

改分类类别

class CocoDataset(CustomDataset):
    CLASSES = ('Benign', 'Malignant', 'none')
    # CLASSES = ('person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
    #            'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
    #            'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
    #            'horse', 'sheep', 'cow', 'elephant', 'bear', 'zebra', 'giraffe',
    #            'backpack', 'umbrella', 'handbag', &

你可能感兴趣的:(目标检测,目标检测,深度学习,计算机视觉)