Caffe编译时没有看到hdf5.h [英] Caffe didn't see hdf5.h when compiling
问题描述
我在 Python 上安装 Caffe 深度学习框架时遇到问题:
I am having trouble when installing Caffe Deep Learning Framework on Python:
当我在 caffe 目录中运行 make
命令时,它说
When I run make
command at caffe directory, it says
hdf5.h:没有那个目录
hdf5.h:no such directory
我已经完成的步骤:
更新和升级我的 Ubuntu 服务器
Update and upgrade my Ubuntu Server
安装 Python 2.7
Install Python 2.7
拥有基于 http://caffe.berkeleyvision.org/install_apt 的所有依赖项.html
运行 cp cp Makefile.config.example Makefile.config
Run cp cp Makefile.config.example Makefile.config
在 Makefile.config 中取消注释 cpu_only = 1
Uncomment cpu_only = 1 in Makefile.config
如果有人能帮助我,我将不胜感激.
I will be grateful if someone can help me.
错误信息:
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
推荐答案
您安装的 Ubuntu 版本是什么?试试这个.在您的 Makefile.config
中,尝试将 /usr/include/hdf5/serial/
附加到 INCLUDE_DIRS
:
What is the version of your Ubuntu install? Try this. In your Makefile.config
try to append /usr/include/hdf5/serial/
to INCLUDE_DIRS
:
--- INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
+++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
并在Makefile
中将hdf5_hl
和hdf5
重命名为hdf5_serial_hl
和hdf5_serial
:
and rename hdf5_hl
and hdf5
to hdf5_serial_hl
and hdf5_serial
in the Makefile
:
--- 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
有关错误修复的更多信息此处.
More about the bug fix here.
这篇关于Caffe编译时没有看到hdf5.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!