caffe ubuntu build

#首先安装依赖项:
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler

#注意libprotobuf-dev 和 protobuf-compiler 版本一致

sudo apt-get install --no-install-recommends libboost-all-dev

sudo apt-get install libatlas-base-dev

sudo apt-get install python-dev

sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

sudo apt-get install --no-install-recommends libboost-all-dev

#修改makefile

cp Makefile.config.example Makefile.config

#根据需要修改

WITH_PYTHON_LAYER := 1

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 /usr/lib/x86_64-linux-gnu/hdf5/serial

#nccl

sudo dpkg -i nccl-repo-.deb

sudo apt-get update

sudo apt install libnccl2 libnccl-dev

#python3

sudo apt-get install python-numpy

sudo ln -s libboost_python-py35.so libboost_python3.so

sudo apt-get install -y python-numpy python-scipy python-matplotlib \

python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx \

python-nose python-pandas python-gflags cython ipython

make all -j 8

make pycaffe -j 8

你可能感兴趣的:(caffe ubuntu build)