【发布时间】:2015-10-11 18:41:16
【问题描述】:
在 Ubuntu 上,我已将 Caffe 下载到 ~/caffe,并使用 cmake 和它附带的 CMakeLists.txt 文件对其进行编译。我现在想开始使用 python 接口。根据示例,我需要将~/caffe/python 添加到我的.bashrc 文件中的PYTHONPATH 变量中。然后,我需要在 python 脚本中使用 import caffe 。但是,这给了我错误:ImportError: No module named 'caffe'。
如果我在我的 python 脚本中使用import caffe 行,这意味着在PYTHONPATH 定义的目录中必须存在一个名为caffe.py 的文件。那是对的吗?但是,我在我的系统上找不到任何名为 caffe.py 的文件。但是CMakeLists.txt 文件应该用于构建python 文件,并且有add_subdirectory(python) 行。
有人有这方面的经验吗?有没有人通过 cmake 编译让 python 接口工作?
谢谢。
【问题讨论】:
-
I have downloaded Caffe to ~/caffe, and compiled it using cmake- 你有没有在构建后安装 caffe?
标签: python cmake makefile caffe