在Python上安装Caffe深度学习框架时,我遇到了麻烦:
当我在caffe目录下运行make命令时,它说
Hdf5.h:没有这样的目录
我所做的步骤:
如果有人能帮我,我会很感激的。
错误消息:
CXX src/caffe/util/hdf5.cpp
in file include from src/caffe/util/hdf5.cpp:1:0:
./include/caffe/util/hdf5.hpp:6:18: fatal error: hdf5.h: No such file or directory
compilation terminated
Makefile:572 recipe for target '.build_release/src/caffe/util/hdf5.o'
failed Make:*** [.build_release/src/caffe/util/hdf5.o] Error 1发布于 2016-05-05 18:03:11
您的Ubuntu安装版本是什么?尝尝这个。在Makefile.config中,尝试将/usr/include/hdf5/serial/附加到INCLUDE_DIRS
--- INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
+++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/并将hdf5_hl和hdf5重命名为Makefile中的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更多关于bug修复这里的信息。
发布于 2017-07-04 18:37:50
这个解决方案在Ubuntu16.04LTS上对我有效。
sudo apt-get install libhdf5-10
sudo apt-get install libhdf5-serial-dev
sudo apt-get install libhdf5-dev
sudo apt-get install libhdf5-cpp-11
find /usr -iname "*hdf5.h*"
/usr/include/hdf5/serial/hdf5.h
export CPATH="/usr/include/hdf5/serial/"发布于 2016-05-24 06:29:21
我经历过的另一个案例是:
我正在使用Ubuntu14.04并安装hdf5-1.10.0。
我发现hdf5.h位于/usr/local/hdf5/include。因此,我修改了Makefile.config文件,将该位置添加到INCLUDE_DIRS中。
# Whatever else you find you need goes here.
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include \
/usr/local/hdf5/include我没有在Makefile中重命名任何东西。效果很好。
https://stackoverflow.com/questions/37007495
复制相似问题