1. apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler

2. git clone https://github.com/BVLC/caffe

cd caffe
cp Makefile.config.example Makefile.config

3. pip install scikit-image protobuf

  cd python for req in $(cat requirements.txt); do sudo pip install $req; done

If TypeError: unsupported operand type(s) for -=: 'Retry' and 'int',

Reason: The computer connects with internet through proxy, so add the --proxy parameter like this:

sudo pip install --proxy=http://dev-myproxy.com:8080 scikit-image protobuf

4. modify the Makefile.config. Uncomment the line CPU_ONLY := 1, and the line OPENCV_VERSION := 3 if only use cpu and opencv3.

5. make all

CXX src/caffe/net.cpp

src/caffe/net.cpp:8:18: fatal error: hdf5.h: No such file or directory compilation terminated. Makefile:575: recipe for target '.build_release/src/caffe/net.o' failed make: *** [.build_release/src/caffe/net.o] Error 1

 

This is because the headfiles of hdf5 is in /usr/include/hdf5/serial/, copy all of them into /usr/include directory.

And then

sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial.so.10.1.0 /usr/lib/x86_64-linux-gnu/libhdf5.so

sudo ln -s /usr/lib/x86_64-linux-gnu/libhdf5_serial_hl.so.10.0.2 /usr/lib/x86_64-linux-gnu/libhdf5_hl.so

 

6. make all again, there will be another error: cann't find cblas.h, no such file or directory.

View the Makefile.config, the option BLAS is atlas, so just install libatlas-base-dev:

apt-get install libatlas-base-dev

7. ld error: can't find -lopencv_imgdecodecs

Wrong opencv version will lead this error.

dpk-config --modversion opencv #check openvcv's version

and then modify the OPENCV_VERSION option in Makefile.config accordingly.

8. make test

9. make runtest

10. make pycaffe

python/caffe/_caffe.cpp:10:31: fatal error: numpy/arrayobject.h: No such file or directory

It was caused because numpy was installed in a different path, and we must manually point to it.

 vi Makefile.config from this:

PYTHON_INCLUDE := /usr/include/python2.7 \

/usr/lib/python2.7/dist_packages/numpy/core/include

to:

PYTHON_INCLUDE :=/usr/include/python2.7 \

/usr/local/lib/python2.7/dist-package/numpy/core/inlcude

 11. Modify PYTHONPATH environment parameter

vi .bashrc

export PYTHONPATH=xxx/caffe/python:$PYTHONPATH

Then we can import caffe in python like this:

import caffe

references:

https://chunml.github.io/ChunML.github.io/project/Installing-Caffe-CPU-Only/

Compile caffe on unbutu 16.0.4的更多相关文章

  1. Ubuntu16.04+Cuda8.0+1080ti+caffe+免OpenCV3.2.0+faster-rCNN教程

    一.事先声明:1.Ubuntu版本:Ubuntu使用的是16.04.而不是16.04.1或16.04.2,这三个是有区别的.笔者曾有过这样的经历,Git上一个SLAM地图构建程序在Ubuntu14.0 ...

  2. ubuntu 16.04源码编译和配置caffe详细教程 | Install and Configure Caffe on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/b90033a9/,欢迎阅读! Install and Configure Caffe on ubuntu 16.04 Series ...

  3. Caffe学习系列(16):caffemodel可视化

    通过前面的学习,我们已经能够正常训练各种数据了.设置好solver.prototxt后,我们可以把训练好的模型保存起来,如lenet_iter_10000.caffemodel. 训练多少次就自动保存 ...

  4. [boost] build boost with intel compiler 16.0.XXX

    Introduction There are few information about how to compile boost with Intel compiler. This article ...

  5. ubuntu 16.04源码编译OpenCV教程 | compile opencv on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/15f5c3e8/,欢迎阅读! compile opencv on ubuntu 16.04 Series Part 1: comp ...

  6. ubuntu 16.04上源码编译dlib教程 | compile dlib on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/c6ead512/,欢迎阅读! compile dlib on ubuntu 16.04 Series Part 1: compil ...

  7. ubuntu 16.04上源码编译opengv | compile opengv on ubuntu 16.04

    本文首发于个人博客https://kezunlin.me/post/1e5d14ee/,欢迎阅读! compile opengv on ubuntu 16.04 Series compile open ...

  8. 安装MYSQL详细教程 版本:mysql-installer-community-5.7.16.0 免安装版本和安装版本出现错误的解决

    一.版本的选择 之前安装的Mysql,现在才来总结,好像有点晚,后台换系统了,现在从新装上Mysql,感觉好多坑,我是来踩坑,大家看到坑就别跳了,这样可以省点安装时间,这个折腾了两天,安装了好多个版本 ...

  9. Navicat Premium 12.1.16.0安装与激活

    声明:本文所提供的所有软件均来自于互联网,仅供个人研究和学习使用,请勿用于商业用途,下载后请于24小时内删除,请支持正版! 本文介绍Navicat Premium 12的安装.激活与基本使用.已于20 ...

随机推荐

  1. 内核中的锁机制--RCU

    一. 引言 众所周知,为了保护共享数据,需要一些同步机制,如自旋锁(spinlock),读写锁(rwlock),它们使用起来非常简单,而且是一种很有效的同步机制,在UNIX系统和Linux系统中得到了 ...

  2. 摘:PC客户端 XP兼容性调查

    现象1:XP SP2下,客户端安装失败(或者启动失败) 解决方案:需要安装以下3个补丁(已经集成到安装包中) ==系统Hotfix(仅仅XP SP2需要安装): http://support.micr ...

  3. Linux内核剖析(二)Linux内核绪论

    什么是内核 内核是操作系统最基本的部分.它是为众多应用程序提供对计算机硬件的安全访问的一部分软件,这种访问是有限的,并且内核决定一个程序在什么时候对某部分硬件操作多长时间.内核的分类可分为单内核和双内 ...

  4. bootstrap-datepicker应用

    参考本人的github:https://github.com/gmqllf/Datepicker-for-Bootstrap (fork官方的) 一.使用datepicker for bootstra ...

  5. PHP事件机制

    先用 3W1H(who what why how) 分析法的思路来解释一下 事件机制, 更重要的是, 这个有什么用. 正常的程序执行, 或者说人的思维趋势, 都是按照 时间线性串行 的, 保持 连续性 ...

  6. crawler_exa1

    编辑中... #! /usr/bin/env python # -*- coding:utf-8 -*- # Author: Tdcqma ''' 网页爬虫,版本 2017-09-20 21:16 ' ...

  7. java.lang.UnsatisfiedLinkError: No implementation found for long org.opencv.core.Mat.n_Mat()

    Android调试openCV4Android的时候出现以下错误 java.lang.UnsatisfiedLinkError: No implementation found for long or ...

  8. 一个第三方Dart库导致的编译错误!

    今天学习flutter过程中,突然程序不能运行了,无论是命令行,抑或Android Studio,还是Idea都是出现同样错误,如下: Running .5s Launching lib\main.d ...

  9. 本人SW知识体系导航 - Programming menu

    将感悟心得记于此,重启程序员模式. js, py, c++, java, php 融汇之全栈系列 [Full-stack] 快速上手开发 - React [Full-stack] 状态管理技巧 - R ...

  10. 【Dubbo 源码解析】02_Dubbo SPI

    Dubbo SPI:(version:2.6.*) Dubbo 微内核 + 插件 模式,得益于 Dubbo SPI .其中 ExtentionLoader是 Dubbo SPI 最核心的类,它负责扩展 ...