导入Caffe错误
问题描述:
我在ubuntu机器上成功编译了caffe,但是无法在python中导入。
i compiled caffe successfully in my ubuntu machine but cannot import in python.
安装了Caffe / home / pbu / Desktop / caffe
Caffe is installed /home/pbu/Desktop/caffe
我尝试将/ home / pbu / caffe / python路径添加到sys.path.append中,但仍无法正常工作
i tried adding the /home/pbu/caffe/python path to sys.path.append, still not working
我正在尝试导入caffe
i am trying to import caffe
root@pbu-OptiPlex-740-Enhanced:/home/pbu/Desktop# python ./caffe/output.py
Traceback (most recent call last):
File "./caffe/output.py", line 13, in <module>
import caffe
File "/home/pbu/Desktop/caffe/python/caffe/__init__.py", line 1, in <module>
from .pycaffe import Net, SGDSolver
File "/home/pbu/Desktop/caffe/python/caffe/pycaffe.py", line 10, in <module>
from ._caffe import Net, SGDSolver
ImportError: No module named _caffe
答
当您没有分别为python文件运行 make
时,就会发生这种情况。
This happens when you have not run make
for the python files separately.
在Caffe目录中运行 make
后立即运行 make pycaffe
。
Run make pycaffe
soon after running make
in the Caffe directory.
您可能必须在 Makefile.config