Caffe的Python接口

来源:互联网 发布:淘宝如何买东西便宜 编辑:程序博客网 时间:2024/04/28 03:35

官方参考: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 by export 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


0 0
原创粉丝点击