caffe深度学习【三】编译错误:fatal error: hdf5.h: No such file or directory compilation terminated.

问题:

今天在配置caffe-SSD时,准备编译caffe遇到了:

fatal error: hdf5.h: No such file or directory compilation terminated.

这样的问题,如下图所示:

原因是没有找到hdf5.h的头文件。

解决方法:

1.修改  Makefile.config  文件

进入到下载的caffe目录

在  Makefile.config  文件中,按住crtl+f  搜索:INCLUDE_DIRS

注意不是  Makefile.config.example!!!

添加/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.修改  Makefile  文件

在  Makefile  文件中,按住crtl+f  搜索:LIBRARIES +=

注意不是上面第1步的  Makefile.config!!!

把 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

结果:

猜你喜欢

转载自blog.csdn.net/qq_38451119/article/details/81383266
今日推荐