【发布时间】:2018-10-18 17:09:23
【问题描述】:
我已经从源代码安装了 caffe。我已经使用 Cmake 进行安装。我也更新了各自的路径。
我的 caffe 根目录是:/home/ashj/caffe
我已将 PYTHON 路径更新为:
export PYTHONPATH=<caffe-home>/python:$PYTHONPATH
这是通过使用
**export PYTHONPATH=/home/ashj/caffe/python:$PYTHONPATH**
我可以加载导入模块 caffe。但是,我无法访问 caffe 中的任何方法或任何层,例如 set_mode_gpu()、set_mode_cpu() 或层或参数。我收到如下错误:
我用的时候
导入咖啡
caffe.set_mode_gpu()
我收到以下错误:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'caffe' has no attribute 'set_mode_gpu'
PS:我也尝试过使用 this link. 中提到的 caffe.__caffe.set_mode_gpu() 但它对我不起作用。 我的系统规格:Ubuntu 18.04
TIA
【问题讨论】:
-
你也有
make pycaffe和make distribute吗? -
我做了'make pycaffe'但我没有做'make distribution'。 'make pycaffe' 没有抛出任何错误。