Introduction: Many online Caffe installation tutorials, their own process with the online or not, the various problems are recorded, convenient for later search
First of all, is to learn the cold teacher's installation tutorial, address https://www.zybuluo.com/hanxiaoyang/note/364680
I am using centos7.2 to meet the requirements in the tutorial.
Installation to the 5th step of the tutorial, there is a NumPy installation problem, install on both sides of the installation. This is a link is not less, do not hurry to go down first.
Until the 10th step, there is no problem.
Paste my Makefile.config, mine is with the GPU, about the installation of the driver will say
# # Refer to Http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system is welcome!
# CuDNN Acceleration Switch (uncomment to build with CuDNN).
# Use_cudnn: = 1
# cpu-only switch (uncomment to build without GPU support).
#CPU_ONLY: = 1
# Uncomment to disable IO dependencies and corresponding data layers
# Use_opencv: = 0
# Use_leveldb: = 0
# Use_lmdb: = 0
# Uncomment to allow Mdb_nolock when reading LMDB files (only if necessary)
# You should no set this flag if you'll be a reading Lmdbs with any
# Possibility of simultaneous read and write
# Allow_lmdb_nolock: = 1
# Uncomment if you ' re using OpenCV 3
# Opencv_version: = 3
# to customize your choice of compiler, uncomment and set the following.
# N.B. The default for Linux are g++ and the default for OSX is clang++
# Custom_cxx: = g++
# CUDA directory contains Bin/and lib/directories that we need.
Cuda_dir: =/usr/local/cuda-7.5
# on Ubuntu 14.04, if Cuda tools is installed via
# "sudo apt-get install Nvidia-cuda-toolkit" then use this instead:
# Cuda_dir: =/usr
# CUDA Architecture setting:going with all of them.
# for CUDA < 6.0, comment the *_50 lines for compatibility.
Cuda_arch: =-gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_20,code=sm_21 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35 \
-gencode arch=compute_50,code=sm_50 \
-gencode arch=compute_50,code=compute_50
# BLAS Choice:
# Atlas for Atlas (default)
# MKL for MKL
# Open for Openblas
BLAS: = Open
# Custom (Mkl/atlas/openblas) include and Lib directories.
# Leave commented to accept the defaults for your choice of BLAS
# (which should work)!
# Blas_include: =/path/to/your/blas
# Blas_lib: =/path/to/your/blas
# Homebrew puts Openblas in a directory that's not on the standard search path
# Blas_include: = $ (Shell brew--prefix Openblas)/include
# Blas_lib: = $ (Shell brew--prefix Openblas)/lib
Blas_include: =/usr/include/openblas
# This is required only if you'll compile the Matlab interface.
# MATLAB directory should contain the MEX binary In/bin.
# Matlab_dir: =/usr/local
# Matlab_dir: =/applications/matlab_r2012b.app
# Note:this is required only if you'll compile the Python interface.
# We need to is able to find Python.h and numpy/arrayobject.h.
Python_include: =/usr/include/python2.7 \
/usr/lib/python2.7/dist-packages/numpy/core/include
# Anaconda Python distribution is quite popular. Include Path:
# Verify Anaconda location, sometimes it's in root.
# Anaconda_home: = $ (HOME)/anaconda
# Python_include: = $ (anaconda_home)/include \
# $ (anaconda_home)/include/python2.7 \
# $ (anaconda_home)/lib/python2.7/site-packages/numpy/core/include \
# Uncomment to use Python 3 (default is Python 2)
# python_libraries: = Boost_python3 python3.5m
# python_include: =/usr/include/python3.5m \
#/usr/lib/python3.5/dist-packages/numpy/core/include
# We need to is able to find libpythonx.x.so or. dylib.
Python_lib: =/usr/lib64
# Python_lib: = $ (anaconda_home)/lib
# Homebrew installs NumPy in a non standard path (keg only)
# Python_include + = $ (dir $ (Shell python-c ' import numpy.core; print (numpy.core.__file__) '))/include
# Python_lib + = $ (Shell brew--prefix numpy)/lib
# Uncomment to support layers written in Python (would link against Python libs)
# With_python_layer: = 1
# Whatever Else you find your need goes here.
Include_dirs: = $ (python_include)/usr/local/include
Library_dirs: = $ (python_lib)/usr/local/lib/usr/lib
# If Homebrew is installed at a non standard location (for example your home directory) and you use it for general Depende Ncies
# Include_dirs + = $ (Shell brew--prefix)/include
# Library_dirs + = $ (Shell brew--prefix)/lib
# Uncomment to the use of ' pkg-config ' to specify OpenCV library paths.
# (usually not necessary--OpenCV libraries is normally installed in one of the above $LIBRARY _dirs.)
# Use_pkg_config: = 1
# n.b. Both build and distribute dirs is cleared on ' make clean '
Build_dir: = Build
Distribute_dir: = Distribute
# Uncomment for debugging. Does not work on OS X due to https://github.com/BVLC/caffe/issues/171
# DEBUG: = 1
# The ID of the GPU that's ' make runtest ' would use to run unit tests.
Test_gpuid: = 0
# Enable pretty build (comment to see full commands)
Q? = @
If there is no gpu,make-j4 the time will be wrong, the hint can not find cblas.h, look at the path configuration blas_include: =/usr/include/openblas is not right
After compiling, make runtest, direct error can not find libpython2.7.so, here is the dynamic library loading, path configuration problem. Because my is a 64-bit system, so python_lib: =/usr/lib64, these places are different machines may not be the same, the best way is to look for the missing so or H file, which is essentially a compile run problem.
Make Pytest also reported segmentation error, looked for a bit, as if the environment variable configuration problem, but not resolved. Finally directly installed TensorFlow go, loaded well found can actually ... It is estimated that when the tensorflow is loaded, Python is loaded with commands.
The following says installing Nvidia and CUDA
Nvidia's installation tutorials are available online, all the same. The problem is, none of them mentioned that when the final installation is encountered, there is no kernel problem.
With the Nvidia driver installed, CUDA has no problem.
Then you can use it.
Caffe installation Process documented