caffe安装过程问题总结

问题:(python中 import caffe)

1、  ImportError: No module named caffe

 

解决方法:

在每个python代码(或者每个python文件)前面加上如下代码,导入caffe路径。

import sys

sys.path.append("/home/xhh/caffe/python")

sys.path.append("/home/xhh/caffe/python/caffe")

 

问题:

2、RuntimeError: module compiled against APIversion 0xa but this version of numpy is 0x9

 

解决方法: 

先在python环境下:

import numpy

printnumpy.__path__

 

找出numpy目录

然后执行下面即可(不用管numpy_old是否存在)

就解决了。

 

-----------------------------------------------------------------------------------------------------------------

原因我也搞不清楚。。。而且我还担心numpy改成了numpy_old之后后面运行程序有问题。 

不过我觉得这个回答是挺中肯的,符合我的情况,但是不清楚怎么操作,难道重新安装么?因为我后来在python上安装了东西的,重新再来一遍好划不来啊。。所以暂且就按上面的方法来吧。


installing packet from file withrequirements may cause failures. I mean something like pip install –r requirements.txt 

it seems to methat pip just installs packets in oreder without dependencies(first line from file,sencondline) 

I had same issuebecause of having installed numpy out side of environment and numpy aftermatplotlib in requirements.txt Pip complied matplotlib with system nympy,afterthat it installed new numpy and nothing worked 

i just haveswitched strings and set matplotlib after numpy now it works

 

 

问题:(python中 import cv2)

3、ImportError: No module named cv2

 

解决方法:

sudo apt-getinstall python-opencv 

 (小写python-opencv 

注:不能用pip安装方式(python-opencv),因为找不到源文件

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值