Caff环境搭建(Ubuntu16.04)

Caffe: a fast open framework for deep learning.   http://caffe.berkeleyvision.org/

安装指南:http://caffe.berkeleyvision.org/install_apt.html

问题1:“fatal error: hdf5.h: 没有那个文件或目录”

参考:https://blog.csdn.net/xue_wenyuan/article/details/52037121

Step 1

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/

Step 2

Makefile文件的第173行,把hdf5_hl 和hdf5修改为hdf5_serial_hlhdf5_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

问题2:nvcc fatal : Unsupported gpu architecture 'compute_20'

参考:https://blog.csdn.net/kemgine/article/details/78781377

仔细查看了一下 Makefile.config 中 CUDA_ARCH 设置未按规定设置:

[html]view plaincopy

# CUDA architecture setting: going with all of them.  

# For CUDA< 6.0, comment the *_50 through *_61 lines for compatibility.  

# For CUDA< 8.0, comment the *_60 and *_61 lines for compatibility.  

# For CUDA>= 9.0, comment the *_20 and *_21 lines for compatibility.  

CUDA_ARCH:= -gencode arch=compute_20,code=sm_20 \  

-gencodearch=compute_20,code=sm_21 \  

-gencodearch=compute_30,code=sm_30 \  

-gencodearch=compute_35,code=sm_35 \  

-gencodearch=compute_50,code=sm_50 \  

-gencodearch=compute_52,code=sm_52 \  

-gencodearch=compute_60,code=sm_60 \  

-gencodearch=compute_61,code=sm_61 \  

-gencodearch=compute_61,code=compute_61  

因为我装的是CUDA9.0所以把下面这两行删除就可以了

[html]view plaincopy

-gencode arch=compute_20,code=sm_20 \  

-gencodearch=compute_20,code=sm_21 \ 

问题3:对‘inflateValidate@ZLIB_1.2.9’未定义的引用

参考:https://blog.csdn.net/zhangruijerry/article/details/79724720

发现ubuntu的zlib版本是1.2.8

然后就去官网下载链接下载了

zlib1g-dev_1.2.11.dfsg-0ubuntu2_amd64.deb    zlib1g_1.2.11.dfsg-0ubuntu2_amd64.deb  

问题4:python/caffe/_caffe.cpp:1:52: fatal error: Python.h: No such file or directory

修改Makefile.config,确保Python_include路径

问题5:/_caffe.so: undefined symbol: _ZN5boost6python6detail11init_moduleER11PyModuleDefPFvvE

参考: https://blog.csdn.net/donatellobzero/article/details/51304162

修改Makefile.config 和 Makefile

#PYTHON_LIBRARIES:= boost_python python3.5m  --》PYTHON_LIBRARIES:= boost_python-py35 python3.6m  

PYTHON_LIBRARIES ?= boost_python python2.7 ---》PYTHON_LIBRARIES := boost_python py34python3.5m 


Caffe搭建:常见问题解决办法和ubuntu使用中遇到问题(持续更新)

你可能感兴趣的:(Caff环境搭建(Ubuntu16.04))