installing Python-dependent libraries
The following two libraries need to be installed because of the need to compile the Python Third-party library
$ sudo yum install python-devel numpy
Setting up the VIRTUALENV environment
$ virtualenv caffeenv
$ cd caffeenv
$ bin/activate
Install the Python third Party library
CD <path_to_caffe>/caffe-1.0/python
pip Install-r requirements.txt
compiling Pycaffe
$ make Pycaffe
Test
First you need to set the environment variable Pythonpath, as follows:
$ export Pythonpath=<path_to_caffe>/caffe-1.0/python: $PYTHONPATH
Run Python, go to interactive mode, and then use "Import Caffe" to test the environment.
Import Caffe
problem
In the construction of the environment also encountered a number of problems, is summarized as follows: The problem of a
The following error occurred while "Import Caffe"
Importerror:no module named _caffe
The problem is that Caffe is not added to the PYTHONPATH environment variable.
The workaround is to set the PYTHONPATH environment variable before running Python.
Export Pythonpath=/home/jhadmin/downloads/caffe-1.0/python: $PYTHONPATH
question two
The following error occurred while "Import Caffe"
Attributeerror: ' Bool_ ' of ' module ' object has no attribute
Solutions
$ make Pycaffe
question three
The following error occurred while "Import Caffe"
Cxx/ld-o python/caffe/_caffe.so python/caffe/_caffe.cpp
python/caffe/_caffe.cpp:10:31:fatal error:numpy/ Arrayobject.h:no such file or directory
#include <numpy/arrayobject.h>
Solutions
sudo yum install NumPy