Compile caffe on unbutu 16.0.4
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的更多相关文章
- 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 ...
- 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 ...
- Caffe学习系列(16):caffemodel可视化
通过前面的学习,我们已经能够正常训练各种数据了.设置好solver.prototxt后,我们可以把训练好的模型保存起来,如lenet_iter_10000.caffemodel. 训练多少次就自动保存 ...
- [boost] build boost with intel compiler 16.0.XXX
Introduction There are few information about how to compile boost with Intel compiler. This article ...
- 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 ...
- 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 ...
- ubuntu 16.04上源码编译opengv | compile opengv on ubuntu 16.04
本文首发于个人博客https://kezunlin.me/post/1e5d14ee/,欢迎阅读! compile opengv on ubuntu 16.04 Series compile open ...
- 安装MYSQL详细教程 版本:mysql-installer-community-5.7.16.0 免安装版本和安装版本出现错误的解决
一.版本的选择 之前安装的Mysql,现在才来总结,好像有点晚,后台换系统了,现在从新装上Mysql,感觉好多坑,我是来踩坑,大家看到坑就别跳了,这样可以省点安装时间,这个折腾了两天,安装了好多个版本 ...
- Navicat Premium 12.1.16.0安装与激活
声明:本文所提供的所有软件均来自于互联网,仅供个人研究和学习使用,请勿用于商业用途,下载后请于24小时内删除,请支持正版! 本文介绍Navicat Premium 12的安装.激活与基本使用.已于20 ...
随机推荐
- JS获取当前日期、比较日期大小
//获取当前时间,格式YYYY-MM-DD function getNowFormatDate() { var date = new Date(); var seperator1 = "-& ...
- FileClassify文件日期分类工具
FileClassify是一款免费的文件按日期分类工具,能够根据文件修改日期,将文件移动或复制到对应的目录中 如果对您有较大的帮助,欢迎捐赠我们,我们对您表示衷心的感谢! 1.输入文件夹和输出文件可以 ...
- JPA学习笔记(3)——JPA注解
Entity Table Id GeneratedValue Basic Column Transient Temporal @Entity @Entity 标注用于实体类声明语句之前.指出该Java ...
- git批量恢复所有删除的文件
git ls-files -d | xargs -i git checkout {}
- GitHubPage博客搭建学习专栏
Hexo NexT 博客本地搭建指南 Hexo NexT 博客与Github page 关联指南 Hexo NexT 博客后台管理指南
- Atitit 关于共享经济之共享男女朋友的创业计划
Atitit 关于共享经济之共享男女朋友的创业计划 1. 共享经济的历史与趋势 1 1.1. 共享经济三大特征=产能过剩+共享平台+人人参与. 1 1.2. 共享经济是个大趋势,使用权渐渐的取代所有权 ...
- Python3 字符串前面加u,r,b的含义
u/U:表示unicode字符串 不是仅仅是针对中文, 可以针对任何的字符串,代表是对字符串进行unicode编码. 一般英文字符在使用各种编码下, 基本都可以正常解析, 所以一般不带u:但是中文, ...
- 程序猿必备的10款超炫酷HTML5 Canvas插件
1.超炫酷HTML5 Canvas 3D旋转地球动画 这是一款基于HTML5 Canvas的3D地球模拟动画,动画以太空作为背景,地球在太空中旋转,同时我们也可以拖拽鼠标来从不同的角度观察地球.另外我 ...
- (转)x264的一些参数设置对编码效率的影响
转自:http://www.cnblogs.com/wainiwann/p/5647521.html i_luma_deadzone[0]和i_luma_deadzone[1]分别对应inter和in ...
- Houdini技术体系 基础管线(四) :Houdini驱动的UE4植被系统 上篇
背景 之前在<Houdini技术体系 过程化地形系统(一):Far Cry5的植被系统分析>一文中已经对AAA游戏中过程化植被的需求有了一定的定义,后续工作就是如何用Houdini开发功能 ...