Install caffe on ubuntu && mac 错误解决办法集锦

来源:互联网 发布:建筑声学设计软件 编辑:程序博客网 时间:2024/06/12 21:57

****************************************************************************************************************

********************************************************UBUNTU**********************************************

****************************************************************************************************************


1、“fatal error: hdf5.h: 没有那个文件或目录”解决方法:


在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/


2、"recipe for target '.build_release/lib/libcaffe.so.1.0.0-rc5' failed"解决方法

在Makefile文件的第181行,把 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


3、"error while loading shared libraries: libXXX.so.X: cannot open shared object file: No such file"解决方法

#sudo ldconfig  


4、caffe 'int' object has no attribute '_values'解决办法:

在caffe/python/caffe/draw.py中第107-111行:把


layer.convolution_param.kernel_size[0] if len(layer.convolution_param.kernel_size) else 1,

                      separator,
                      layer.convolution_param.stride[0] if len(layer.convolution_param.stride) else 1,
                      separator,

layer.convolution_param.pad[0] if len(layer.convolution_param.pad) else 0)


修改为:


                      pooling_types_dict[layer.pooling_param.pool],
                      layer.type,
                      separator,
                      layer.pooling_param.kernel_size,
                      separator,
                      layer.pooling_param.stride,
                      separator,
layer.pooling_param.pad)



****************************************************************************************************************

********************************************************MAC***************************************************

****************************************************************************************************************

cblas.h

openblas,设置Makefile.config

BLAS := open

路径

 BLAS_INCLUDE := /usr/local/opt/openblas/include
 BLAS_LIB := /usr/local/opt/openblas/lib


所需要的文件都在

/usr/local/opt/boost/lib

复制到

/usr/local/lib


error when create lmdb:

"dyld: Library not loaded: @@HOMEBREW_PREFIX@@/opt/openblas/lib/libopenblasp-r0.2.19.dylib"

/usr/local/opt/gcc/lib/gcc/7

/usr/local/lib
原创粉丝点击