简体   繁体   English

使用anaconda 3 for python 3.4在ubuntu 15.04上安装caffe - 找不到模块caffe

[英]Installing caffe on ubuntu 15.04 with anaconda 3 for python 3.4 - no module caffe found

I am trying to install caffe on my ubuntu 15.04 with anaconda 3 (for python 3.4). 我正在尝试使用anaconda 3(对于python 3.4)在我的ubuntu 15.04上安装caffe。 I managed to install all requirements and I followed the instructions from official website. 我设法安装了所有要求,我按照官方网站的说明进行操作。 So I downloaded caffe-master and did: 所以我下载了caffe-master并做了:

cd ./caffe-master
make all
make pycaffe

It completes fine, no errors (finally). 它完成得很好,没有错误(最后)。 But after that if I go into anaconda and do 但之后如果我进入anaconda并做到了

import caffe

I get no module caffe is found. 我没有找到模块caffe。 What am I doing wrong? 我究竟做错了什么? Any ideas? 有任何想法吗?

Finally solved. 终于解决了。 Honestly the issue was in incorrect makefile.config. 老实说问题是makefile.config不正确。 I needed to be extremely careful in adjusting it to specify all path to anaconda folders - I have incorrectly specified the path to python3.4 libraries. 我需要非常小心地调整它以指定anaconda文件夹的所有路径 - 我错误地指定了python3.4库的路径。

The point is - when set up caffe with anaconda and facing issues you need to go over makefile.config one more time - you should have misconfigured something 关键是 - 当使用anaconda设置caffe并面临问题时,你需要再次使用makefile.config - 你应该错误配置一些东西

you can try these steps: 你可以尝试这些步骤:

To use caffe within python, export its path as 要在python中使用caffe,请将其路径导出为

export PYTHONPATH=~/Home/ username /caffe/python:$PYTHONPATH export PYTHONPATH =〜/ Home / username / caffe / python:$ PYTHONPATH

Replace username with the your username in the system. 将用户名替换为系统中的用户名。

Once you've done this, run the python terminal and import caffe 完成后,运行python终端并导入caffe

import caffe 进口咖啡

If it throws a 'module not found' error, check if it has been appended in pythonpath properly by typing 如果它抛出'找不到模块'错误,请通过键入检查它是否已正确附加在pythonpath中

import sys sys.path ['', '/home/nikita/caffe/python', '/home/nikita', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu', '/usr/lib /python2.7/lib-tk', '/usr/lib/python2.7/lib-old', '/usr/lib/python2.7/lib-dynload', '/home/nikita/.local/lib/python2.7/site- packages'] import sys sys.path ['','/ home / nikita / caffe / python','/ home / nikita','/ usr / lib / python2.7','/ usr / lib / python2.7 /plat- x86_64-linux-gnu','/ usr / lib /python2.7/lib-tk','/ usr / lib / python2.7 / lib-old','/ usr / lib / python2.7 / lib-dynload ','/ home / nikita /.local/lib/python2.7/site- packages']

If you see that the /home/username /caffe/python path, isn't there, then do 如果你看到/ home / username / caffe / python路径不存在,那就去做吧

sys.path.append('/Home/username/caffe/python') sys.path.append( '/主页/用户名/朱古力/蟒蛇')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM