【问题标题】:“No module named caffe” error when trying to run python program尝试运行 python 程序时出现“没有名为 caffe 的模块”错误
【发布时间】:2018-12-18 04:26:47
【问题描述】:

我最近开始做深沉的梦想视觉特效,但在我输入 bash python video.py 后出现此错误:

Traceback (most recent call last):
  File "video.py", line 19, in <module>
    import caffe
ImportError: No module named caffe

我是这方面的新手,我查了3天还是不知道,有人可以帮忙吗?我尝试使用 these instructions 安装 caffe,但在运行 make all 时不断出现错误。在另一个线程上,他们说要下载并设置 OpenCV 以使其工作,但这也失败了......

这些是我在安装 Caffe 时遇到的错误

CXX src/caffe/layers/hdf5_data_layer.cpp
src/caffe/layers/hdf5_data_layer.cpp:13:10: fatal error: hdf5.h: No such file or directory
 #include "hdf5.h"
          ^~~~~~~~
compilation terminated.
Makefile:581: recipe for target '.build_release/src/caffe/layers/hdf5_data_layer.o' failed
make: *** [.build_release/src/caffe/layers/hdf5_data_layer.o] Error 1

这是我在尝试完成 OpenCV 设置时遇到的错误:

c@c-VirtualBox:~/opencv$ python removeRedEyes.py
python: can't open file 'removeRedEyes.py': [Errno 2] No such file or directory

虽然有很多关于此的帖子,但从 2015 年到 2016 年,它们似乎都已经过时了。

【问题讨论】:

  • @hootnot 这似乎已经过时了...你没看我的问题吗?
  • 我看到一个答案(2017 年 7 月)安装与包含 hdf5.h 文件的 hdf5-dev 相关的软件包,得分为 11 分。没有这似乎是您的问题之一。
  • 好吧,把链接发给我吧……
  • ? ...见第一条评论

标签: python caffe deep-dream


【解决方案1】:

如果您使用的是 Linux,请将 +++ INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/ 添加到您的 Makefile.config

【讨论】:

    猜你喜欢
    • 2019-06-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-11-27
    相关资源
    最近更新 更多