栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

ubuntu搭建mmdetection

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

ubuntu搭建mmdetection

Step0:以下为个人基本环境版本:
  • ubuntu 20.04
  • cuda 11.2
  • pytorch 11.7.0
  • python 3.6
Step1:配置mmcv

github上已有预训练的版本,可以根据自己的下载下

GitHub - open-mmlab/mmcv: OpenMMLab Computer Vision Foundation

pip install mmcv-full==1.3.9 -f https://download.openmmlab.com/mmcv/dist/cu110/torch1.7.0/index.html
  • cuda 11.X的是可以跟cuda 11.0共用的
  • 安装最新版的,后续可能会报错
Step2-1:进到mmdection下载源码

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

git clone https://github.com/open-mmlab/mmdetection.git
Step2-2:安装依赖包

把mmdetection-master/requirements/tests.txt 打开,修改onnx onnxruntime版本号

打开 terminal

cd mmdet-master
pip install -r requirements.txt
Step3:安装cocoapi数据集

https://github.com/cocodataset/cocoapi

git clone https://github.com/cocodataset/cocoapi.git
cd cocoapi-master/PythonAPI
pip install -v -e.
Step4:回到mmdection安装
cd mmdet-master
python setup.py develop
Step5:Demo 测试

到mmdetection-master 新建一个资料夹 checkpoints

把训练过得model放进去

下载

cd mmdet-master
python demo/image_demo.py demo/demo.jpg configs/faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco.py checkpoints/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco-5324cff8.pth

结果跑出 AssertionError: MMCV==1.3.9 is used but incompatible. Please install mmcv>mmcv_version=1.3.17, <=1.6.0.

 

解决方式 进到 mmdetection-master/mmdet/__init__.py 修改判断 1.3.17 ➝ 1.3.2

再Run一次

cd mmdet-master
python demo/image_demo.py demo/demo.jpg configs/faster_rcnn/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco.py checkpoints/faster_rcnn_r50_caffe_fpn_mstrain_1x_coco-5324cff8.pth

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1012334.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号