ubuntu配置mmdetection 的CPU版本

由于大多数的服务器没有GPU,我们想要在上面跑openmmlab项目中的mmdetection需要装CPU版本的,由于官方的感觉有点模糊,所以自己搜索资料跑通了一个[mmdetection连接]
(https://github.com/open-mmlab/mmdetection)、
当然mmlab其他项目应该也是类似的

1.首先老样子,创建环境

conda create -n mmlab python=3.6 -y
conda activate open-mmlab

2.然后,安装torch的cpu版本

pip install torch==1.5.0 torchvision==0.6.0

这个可能有点慢,分享一手whl

3.接着,安装mmcv-full

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

注意最后的torch版本要根自己的版本对应

4.再接着安装requirements和setup.py

pip install -r requirements/build.txt
cd {mmdetection存在路径}
python setup.py develop

5.最后,跑代码

python demo/image_demo.py demo/demo.jpg configs/faster_rcnn/faster_rcnn_r101_fpn_1x_coco.py weights/faster_rcnn/faster_rcnn_r101_fpn_1x_coco_20200130-f513f705.pth --device cpu

第一个

demo/image_demo.py #这个是识别调用接口

第二个

demo/demo.jpg #识别的图片

第三个

configs/faster_rcnn/faster_rcnn_r101_fpn_1x_coco.py#调用的是哪个算法模块

第四个

weights/faster_rcnn/faster_rcnn_r101_fpn_1x_coco_20200130-f513f705.pth#这个是权重文件的位置,这个weights的文件是我自己创建的

权重文件可以在configs文件夹下某一个如faster_rcnn文件夹中的
README.md文件中找到,一定要找对应的

第五个

--device cpu#这个就是运行的设备,是cpu

还有就是最近新出的一个involuntion算子想用cpu跑通用在项目中不过貌似必须要cuda

版权声明:本文为CSDN博主「Flowiiiing」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/shananshuibei/article/details/116498821

Flowiiiing

我还没有学会写个人说明!

暂无评论

发表评论

相关推荐

【MMDetection 目标检测框架学习】

前言 一、入门 【环境配置/软件安装】win10配置mmdetection.入门篇一、各组件解读,配置文件解读.入门篇二、训练自己的数据集. 二、MMCV 【MMCV 源码解读】一、Config(配置文件相关

【无标题】

mmdetection中的faster-rcnn训练自己的voc数据集 1、首先先安装好mmdetection 2、安装好后在mmdetection文件夹下新建一个data数据集把voc数据集放进去 3、然后找到你的目录下的config/fa

MMdetection之necks之FPN

MMdetection之necks之FPN 其横向为 1X1 的卷积,向下为 上采样 Specifically, for ResNets [16] we use the feature activations output by