Hand – to – hand teaching to build caffe and handwritten number recognition

\

\

Time: November 9, 2016 communication: Deep learning practical communication Q group 472899334, if you have questions, you can add this group to communicate together. To explore the principles behind experiments, see deep Learning Online. \

\

\

One, foreword

In the previous tutorial, we built TensorFlow and Torch, and after the tutorial was released, you had far fewer questions. However, caffe also has many problems, and caffe is one of the three frames to be covered in the deep Learning online class. Therefore, we went through caffe’s construction again, hand in hand and command prompt throughout. This tutorial is based on github: github.com/BVLC/caffe and page P28 of 21 Days caffe.

In addition, my installation environment is Ubuntu14.04, CUDA8.0, CudNn5.1, OpenCV, GTX1070. Check out the installation tutorials in “Flappy Bird” and “Van Gogh Painting with Tensorflow” for more information.

\

 

Install dependencies

Update the source

sudo apt-get update

Refer to the website page address: http://caffe.berkeleyvision.org/install_apt.html

Install command:

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

Note: Holding CTRL + Shift + C on the Ubuntu command line is to copy, and CTRL + Shift + V is to paste

 

 

Iii. Related installation

Install git command:

sudo apt-get install git

Install the BLAS command:

sudo apt-get install libatlas-base-dev

Dependencies required to install the PyCaffe interface:

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

Install other dependencies:

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

 

 

4. Caffe related operations

Download caffe:

sudo git clone Github.com/BVLC/caffe….

Enter the caffe:

cd caffe

Configure the makefile. config file:

sudo cp Makefile.config.example Makefile.config

Modify the Makefile. Config:

sudo vi Makefile.config

I’m using Cudnn here, so I’ll go to the fourth line

# USE_CUDNN := 1

USE_CUDNN := 1

Schematic diagram:

Compile the caffe:

Run the following commands in sequence

sudo make all -j16

sudo make test -j16

sudo make runtest -j16

 

 

The caffe file used to compile Python

Compile the caffe:

Run the following command

make pycaffe -j16

 

 

Six, validation,

cd python

python

import caffe

No error indicates that the installation is successful!

\

\

\

Handwritten number recognition based on CAFFe

Caffe MNIST by Xiao CAI Github: github.com/BVLC/caffe CD /caffe/caffe 1. Download data./data/mnist/get_mnist.sh 2. Convert it to the LMDB format./examples/mnist/create_mnist.sh 3. Training data./examples/mnist/train_lenet.sh

\

\

On the other, caffe under MAC installation, please refer to: ask.julyedu.com/question/74… . July online ta team, November 9, 2016.