Caffe: Caffe的Python接口

官方参考:http://caffe.berkeleyvision.org/installation.html

官方介绍是这样的:
Python

The main requirements are numpy and boost.python (provided by boost).pandas is useful too and needed for some examples.

You can install the dependencies with:

for req in $(cat requirements.txt); do pip install $req; done


but we suggest first installing the Anaconda Python distribution, which provides most of the necessary packages, as well as thehdf5 library dependency.

To import the caffe Python module after completing the installation, add the module directory to your$PYTHONPATH byexport PYTHONPATH=/path/to/caffe/python:$PYTHONPATH or the like. You should not import the module in thecaffe/python/caffe directory!


1. 对于:for req in $(cat requirements.txt); do pip install $req; done

这句shell,可能会运行无效,要把requriments 里面的软件要求顺序变更一下,安装完其他包后,依次安装ipython和h5dy;


2. 添加caffe的python包含路径:

你所添加的路径是:export PYTHONPATH=/home/wishchin/caffe-master/python:$PYTHONPATH

                        而非:export PYTHONPATH=/home/wishchin/caffe-master/python/caffe:$PYTHONPATH

修改后update一下,或者重启,可以在任一项目中import caffe


3.对于Eclipse,可以在preference-python-Interpretor里面直接添加路径

注意事项: 若是第一次在Eclipse中引用出现错误。Don't panic! 重启一下eclipse就可以了。


若想在一个工程中引用Caffe,暂时没有想到可行的方法.....................................................

后记: 在eclipse工程中添加引用目录,直接import caffe

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值