- ubuntu 20.04
- cuda 11.2
- pytorch 11.7.0
- python 3.6
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共用的
- 安装最新版的,后续可能会报错
https://github.com/open-mmlab/mmdetection
git clone https://github.com/open-mmlab/mmdetection.gitStep2-2:安装依赖包
把mmdetection-master/requirements/tests.txt 打开,修改onnx onnxruntime版本号
打开 terminal
cd mmdet-master pip install -r requirements.txtStep3:安装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 developStep5: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



