caffe pyenv 安装

pyenv 安装 pycaffe

git clone https://github.com/BVLC/caffe.git
sudo apt-get install protobuf-c-compiler protobuf-compiler
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-dev libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler 
sudo apt-get install -y libgflags-dev libgoogle-glog-dev liblmdb-dev protobuf-compiler
sudo apt-get install libatlas-base-dev

Makefile.config

USE_CUDNN := 1
OPENCV_VERSION := 3		# opencv4也是这样
CUSTOM_CXX := g++
WITH_PYTHON_LAYER := 1
PYTHON_INCLUDE := /home/hgw/.pyenv/versions/2.7.15/envs/env2715/include/python2.7 \
                  /home/hgw/.pyenv/versions/2.7.15/envs/env2715/lib/python2.7/site-packages/numpy/core/include
PYTHON_LIB:=/home/hgw/.pyenv/versions/2.7.15/envs/env2715/lib

error
/usr/bin/x86_64-linux-gnu-ld: cannot find -lhdf5_hl
/usr/bin/x86_64-linux-gnu-ld: cannot find -lhdf5

sudo find / -name libhdf5.so

/usr/include/hdf5/serial/
/usr/lib/x86_64-linux-gnu/hdf5/serial/

INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /usr/lib/x86_64-linux-gnu/hdf5/serial/

Makefile

CXXFLAGS += -pthread -std=c++11 -fPIC $(COMMON_FLAGS) $(WARNINGS)
# LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_hl hdf5
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl hdf5_serial

hdf5_serial_hl
hdf5_serial

编译caffe

make all -j11

出现问题

make clean
make all -j11

编译pycaffe

make pycaffe -j12
make all -j12
make test -j12
make runtest -j12
gedit ~/.bashrc
export PYTHONPATH="/home/hgw/ubtrobot/git/caffe/python"
source ~/.bashrc

参考

你可能感兴趣的:(DeepLearning)