仅支持CPU模式

sudo apt-get install libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler

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

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

sudo apt-get install libatlas-base-dev

sudo apt-get install libopenblas-dev

sudo apt-get install python-dev

sudo apt-get install python-numpy

sudo apt-get install python-matplotlib

git clone https://github.com/BVLC/caffe.git

cd caffe

cp Makefile.config.example Makefile.config
# Adjust Makefile.config (for example, if using Anaconda Python, or if cuDNN is desired)

gedit Makefile.config

# uncomment the CPU-only let CPU_ONLY = 1 uncomment

make all

make test

make runtest

第一个实验MNIST

./data/mnist/get_mnist.sh
./example/mnist/create_mnist.sh
gedit examples/mnist/lenet_solver.prototxt
# change the solver mode to CPU
# solver_mode: CPU
./exameple/mnist/train_lenet.sh

最后结果显示

I1203 solver.cpp:84] Testing net
I1203 solver.cpp:111] Test score #0: 0.9897
I1203 solver.cpp:111] Test score #1: 0.0324599
I1203 solver.cpp:126] Snapshotting to lenet_iter_10000
I1203 solver.cpp:133] Snapshotting solver state to lenet_iter_10000.solverstate
I1203 solver.cpp:78] Optimization Done.