介绍

Detectron是FAIR推出的一款优秀的物体检测、分割框架,基于caffe2,其中包含了Faster RCNN、Mask RCNN、FPN、RetinaNet、R-FCN、Openpose等常见的模型。可能是由于何凯明的缘故吧,Facebook集成了许多他提出的模型。该框架可以很方便的把这些模型应用到自己的工程和项目中,下面将具体介绍如何安装和配置caffe2和detectron。

安装配置caffe2

caffe2的安装网上教程有很多,但是有可能安装不成功,facebook开源的pytorch框架已经把caffe2集成到里面去啦~所以只需要安装pytorch即可。首先安装下依赖环境:

$ sudo apt-get update
$ sudo apt-get install -y --no-install-recommends \build-essential \cmake \git \libgoogle-glog-dev \libgtest-dev \libiomp-dev \libleveldb-dev \liblmdb-dev \libopencv-dev \libopenmpi-dev \libsnappy-dev \libprotobuf-dev \openmpi-bin \openmpi-doc \protobuf-compiler \python-dev \python-pip
$ sudo pip install \future \numpy \protobuf# for Ubuntu 16.04
$ sudo apt-get install -y --no-install-recommends libgflags-dev

然后进入pytorch官网 "https://pytorch.org"找到适合自己的pytorch版本,然后根据推荐的指令进行安装即可,在这里我的是 pip3 install torch torchvision

然后在命令栏中进行安装即可。安装完成之后,进行测试,没有报错,说明安装成功。

oliver@oliver-System-Product-Name:~$ python
Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import caffe2
>>>

当出现No module named ‘past’ 错误之后,进行以下两个命令即可:

pip install future
pip install --upgrade future

当下面测试通过时,说明caffe2的安装配置成功啦~

$ python3 -c 'from caffe2.python import core' 2>/dev/null && echo "Success" || echo "Failure"
Success
$ python3 -c 'from caffe2.python import workspace; print(workspace.NumCudaDevices())'
1

安装配置detectron

当完成caffe2的环境搭建之后,就可以配置detectron啦~,首先需要把源文件下载到本地

git clone https://github.com/facebookresearch/detectron

然后转到detectorn文件夹内:

pip install -r requirements.txt如果权限不够的话:
pip install --user -r requirements.txt

接着:

make

make完成之后就算配置好detectron啦,下面来测试下,是否配置成功,进入requirements.txt目录下:

python detectron/tests/test_spatial_narrow_as_op.py

出现以下结果即是配置成功:

oliver@oliver-System-Product-Name:~/detectron$ python detectron/tests/test_spatial_narrow_as_op.py
net_drawer will not run correctly. Please install the correct dependencies.
[E init_intrinsics_check.cc:43] CPU feature avx is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E init_intrinsics_check.cc:43] CPU feature avx2 is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
[E init_intrinsics_check.cc:43] CPU feature fma is present on your machine, but the Caffe2 binary is not compiled with it. It means you may not get the full speed of your CPU.
Found Detectron ops lib: /home/oliver/.local/lib/python3.6/site-packages/torch/lib/libcaffe2_detectron_ops_gpu.so
...
----------------------------------------------------------------------
Ran 3 tests in 2.160sOK

ubuntu16.04下安装配置caffe2和detectron(亲测有效,非常简单)相关推荐

  1. QT 5.9.8在ubuntu16.04下安装配置

    一.下载基于Linux的qt安装文件 网址为:http://download.qt.io/official_releases/qt/ 选择自己喜欢的版本下载即可.本文示例的是qt-opensource ...

  2. ubuntu16.04 下安装配置python3.6

    在ubuntu 16.04版本中,系统默认安装 了python 2.7和3.5版本,但在开发过程中我们可能用到到python3.6,删除默认的版本又担心系统有问题,因此可以选择在系统中再装上pytho ...

  3. wepe 装linux ubuntu,Ubuntu16.04下安装Wechat的实现方法

    Ubuntu16.04下安装Wechat 很久没写博客了,前两天电脑因为teamviewer不了,原因显示是libqt5gui5版本过低,研究了一波更新,卸载了libqt5gui5,和它的依赖qtba ...

  4. Ubuntu16.04下安装tensorflow(CPU)spyder+pycharm

    1.下载并安装Anaconda 1.1 下载 从Anaconda官网(https://www.continuum.io/downloads)上下载Linux版本 https://repo.contin ...

  5. 在ubuntu16.04下安装opencv4.1.1(借鉴多篇的成果,爬了些许坑)(001)

    在ubuntu16.04下安装opencv4.1.1(借鉴多篇的成果,爬了些许坑) 一 下载 先去github上下载对应的opencv版本和opencv_contrib版本,我下载的是opencv4. ...

  6. ubuntu16.04 下安装Opencv2.4.9

    ubuntu16.04 下安装Opencv2.4.9 OpenCV的源码download from:  https://sourceforge.net/projects/opencvlibrary/? ...

  7. ubuntu16.04下安装openssh-server报依赖错误的解决方法

    ubuntu16.04下安装openssh-server报依赖错误的解决方法 参考文章: (1)ubuntu16.04下安装openssh-server报依赖错误的解决方法 (2)https://ww ...

  8. Ubuntu16.04下安装有道翻译

    Ubuntu16.04下安装有道翻译 参考: https://www.cnblogs.com/pursuiting/p/6194682.html 下载并安装3个依赖包 下载并安装有道词典 下载并安装3 ...

  9. Ubuntu16.04 下安装 Teamviewer 远程控制软件

    TeamViewer软件介绍: TeamViewer是一个能在任何防火墙和NAT代理的后台用于远程控制的应用程序,桌面共享和文件传输的简单且快速的解决方案.为了连接到另一台计算机,只需要在两台计算机上 ...

  10. ubuntu16.04下安装企业微信和微信(实测能用)

    ubuntu16.04下安装企业微信和微信(实测能用) 安装deepin 安装企业微信 安装微信 安装deepin 第一步: git clone https://gitee.com/wszqkzqk/ ...

最新文章

  1. python和c哪个适合入门-C 语言和 Python,该从哪个入门编程?
  2. 23种设计模式C++源码与UML实现--组合模式
  3. matplotlib的基本使用1
  4. 终于有人把SaaS讲明白了
  5. 开源通用爬虫框架YayCrawler-页面的抽取规则定义
  6. python写入指定行_python文件操作如何写在指定的行
  7. 海思uboot启动流程详细分析(二)
  8. SpringBoot结合Druid配置JNDI多数据源
  9. Web.py session用户认证
  10. (超详细)搜索软件Everything的安装与使用
  11. 网络接入与身份认证简介
  12. java ppt转图片 失真_Apache POI将PPT转换成图片实例代码
  13. stringexample.java_给出如下声明:String s = “Example”; 合法的代码有哪些?()_学小易找答案...
  14. 自学Python编程的第\七天----------来自苦逼的转行人
  15. Android进程永生技术终极揭秘:进程被杀底层原理、APP应对技巧
  16. 小说里的编程 【连载之十六】元宇宙里月亮弯弯
  17. 从零到熟悉,带你掌握Python len() 函数的使用
  18. Ptolemy 11-28
  19. CCF-CSP认证 历届第一题
  20. 音频增强工具:DeskFX Plus Mac

热门文章

  1. 新手学习selenium路线图(老司机亲手绘制)-学前篇
  2. Android 开源框架Universal-Image-Loader完全解析(二)--- 图片缓存策略详解
  3. PHP+Mysql+jQuery实现发布微博程序(PHP篇)
  4. [Xamarin] 客製化的ListView之章 (转帖)
  5. SQL Server 字符串拆分
  6. Yii 2.0 权威指南(7) 关键概念
  7. 文件备份软件 FreeFileSync
  8. linux netcat命令实例
  9. VS2015 编译boost
  10. python中rawinput用法_Python 中 input()用法 以及与raw_input() 的区别