gpt4 book ai didi

python - Caffe 编译时没有看到 hdf5.h

转载 作者:IT老高 更新时间:2023-10-28 20:35:43 29 4
gpt4 key购买 nike

在 Python 上安装 Caffe 深度学习框架时遇到问题:

当我在 caffe 目录运行 make 命令时,它会说

hdf5.h:no such directory

我做过的步骤:

  • 更新和升级我的 Ubuntu 服务器

  • 安装 Python 2.7

  • 拥有基于 http://caffe.berkeleyvision.org/install_apt.html 的所有依赖项

  • 运行 cp cp Makefile.config.example Makefile.config

  • 在 Makefile.config 中取消注释 cpu_only = 1

如果有人可以帮助我,我将不胜感激。

错误信息:

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:

--- INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include
+++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/

并在 Makefile 中将 hdf5_hlhdf5 重命名为 hdf5_serial_hlhdf5_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

有关错误修复的更多信息 here .

关于python - Caffe 编译时没有看到 hdf5.h,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37007495/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com