Ubuntu 14.04 64位机上不带CUDA支持的Caffe配置编译操作过程+faster-rcnn

下面介绍在Ubuntu上只用CPU的Caffe配置编译过程:

1.安装BLAS:$ sudo apt-get install libatlas-base-dev

2.安装依赖项:$ sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev protobuf-compiler liblmdb-dev

$ sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

3. 下载Caffe:$ git clone git://github.com/BVLC/caffe.git
4.

安装Caffe: $cd caffe

$ cp Makefile.config.example Makefile.config

修改Makefile.config文件:去掉注释,CPU_ONLY:= 1

修改 caffe目录下的Makefile.config,Makefile

$gedit Makefile.config;

在Makefile.config文件的第85行,添加 /usr/include/hdf5/serial/ 到 INCLUDE_DIRS,也就是把下面第一行代码改为第二行代码。

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

# Uncomment to support layers written in Python (will link against Python libs)
# WITH_PYTHON_LAYER := 1

# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include\
                                  /usr/include/hdf5/serial/ 
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib

gedit Makefile;

在Makefile文件的第173行,把 hdf5_hl 和hdf5修改为hdf5_serial_hl 和 hdf5_serial,也就是把下面第一行代码改为第二行代码。
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5

LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

INCLUDE_DIRS += $(BUILD_INCLUDE_DIR) ./src ./include
ifneq ($(CPU_ONLY),1)
	INCLUDE_DIRS += $(CUDA_INCLUDE_DIR)
	LIBRARY_DIRS += $(CUDA_LIB_DIR)
	LIBRARIES := cudart cublas curand
endif
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial 

5.

$ make all

$ make test

$ make runtest

说明:1.make all步骤出现错误
./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory

解决方法如步骤4

2.编译带CUDA支持的Caffe与上面的步骤完全一致,只要把CPU_ONLY:=1注释掉即可。

CPU运行faster-rcnn:参考博客:http://www.cnblogs.com/justinzhang/p/5386837.html

参考文献:

1. http://caffe.berkeleyvision.org/installation.html

2.http://m.blog.csdn.net/blog/zxd675816777/39649281

3.http://www.haodaima.net/art/2823705

5.http://www.cnblogs.com/platero/p/3993877.html

6.http://blog.csdn.net/kuaitoukid/article/details/40395617

7.
http://blog.csdn.net/u011762313/article/details/47262549#%E5%AE%89%E8%A3%85%E4%BE%9D%E8%B5%96%E5%BA%93%E4%B8%80

8

http://blog.csdn.net/hongye000000/article/details/51043913

http://www.jb51.cc/article/p-xmydevyj-ux.html

http://www.jb51.cc/article/p-evvodmjx-gt.html

http://www.cnblogs.com/simplelovecs/p/5156458.html

http://blog.csdn.net/u011762313/article/details/47262549

http://www.jb51.cc/article/p-evvodmjx-gt.html

http://www.jb51.cc/article/p-claeqeyj-k.html

https://github.com/rbgirshick/py-faster-rcnn

http://demo.netfoucs.com/danieljianfeng/article/details/42836167

http://blog.csdn.net/wishchin/article/details/52327257

dawei

【声明】:淮南站长网内容转载自互联网,其相关言论仅代表作者个人观点绝非权威,不代表本站立场。如您发现内容存在版权问题,请提交相关链接至邮箱:bqsm@foxmail.com,我们将及时予以处理。