Caffe installation and compilation

Installation conditions

A computer with the Ubuntu operating system

Installation Steps Ubuntu

Command line:

sudo apt-get install git
sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler
sudo apt-get install libatlas-base-dev
sudo apt-get install python-dev
sudo apt-get install libgflags-dev libgoogle-glog-dev liblmdb-dev

Download Caffe Source:

git clone https://github.com/bvlc/caffe.git
cd caffe/
mv Makefile.config.example Makefile.config

Modify Makefile.config, first use the CPU
canceled CPU_ONLY: = 1 Comment

Compile

make -j

Compile Error

[Caffe compilation] fatal error: hdf5.h: No such file or directory

Find Files

locate hdf5.h
#修改Makefile.config文件,在下面的语句后面增加红色部分
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /usr/include/hdf5/serial/ 
#Makefile中修改为
LIBRARIES += glog gflags protobuf boost_system boost_filesystem m hdf5_serial_hl 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
#清理编译
make clean
#重新编译,八个线程
make -j8

Running in virtual machines accelerated method

Caffe dependencies

ProtoBuffer

Parameter Management Tools

Boost

C ++ Standard Library

gflags

Parse command line arguments

hawthorn

Utility Library logger logs

BLAS

Linear Algebra Subprograms

HDF5

Store different types of data and digital images

OpenCV

LMDB and LEVELDB

Database Manager

Snappy

Compression and decompression of C ++ libraries

Released two original articles · won praise 5 · Views 1275

Guess you like

Origin blog.csdn.net/qq_35494379/article/details/101309302