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/
在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
問題2:nvcc fatal : Unsupported gpu architecture 'compute_20'
參考:https://blog.csdn.net/kemgine/article/details/78781377
仔細查看了一下 Makefile.config 中 CUDA_ARCH 設置未按規(guī)定設置:
[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
發(fā)現(xiàn)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?