Caffe linux install

caffe —can not find lhdf5_hl.so lhdf5.so error

解决如果不修改出现的找不到hdf5相关文件的问题

将# Whatever else you find you need goes here.下面的
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib
修改为:
INCLUDE_DIRS :=  $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu/hdf5/serial
cd /usr/lib/x86_64-linux-gnu
 //if no "x86_64-linux-gnu" dirtectory,  use "sudo find / -name "libhdf5_serial.so.10.1.0" to find the directroy the lib in, my directory is "/usr/lib/i386-linux-gnu".
//然后根据情况执行下面两句:
sudo ln -s libhdf5_serial.so.10.1.0 libhdf5.so
sudo ln -s libhdf5_serial_hl.so.10.0.2 libhdf5_hl.so

fatal error: numpy/arrayobject.h没有那个文件或目录(fatal error: numpy/arrayobject.h: No such file or directory)

import numpy as np
np.get_include()

得到:
/usr/local/lib/python2.7/dist-packages/numpy/core/include

在Makefile.config找到PYTHON_INCLUDE,发现有点不同:

PYTHON_INCLUDE := /usr/include/python2.7
/usr/lib/python2.7/dist-packages/numpy/core/include

要加一个local,变成:
PYTHON_INCLUDE := /usr/include/python2.7
/usr/local/lib/python2.7/dist-packages/numpy/core/include
再make pycaffe就ok了

你可能感兴趣的:(Linux,Caffe)