How to Train the Lenet network using Caffe + MNIST on Ubuntu 14.04 64-bit Machine
How to Train the Lenet network using Caffe + MNIST on Ubuntu 14.04 64-bit Machine
1. Locate the terminal to the Caffe root directory;
2. Download and decompress the MNIST Database: $./data/mnist/get_mnist.sh
3. convert it to the Lmdb database format: $./examples/mnist/create_mnist.sh
After the shell script is executed, two new directories will be added under./examples/mnist, mnist_test_lmdb and mnist_train_lmdb.
4. train model: $./examples/mnist/train_lenet.sh
(1) Use the LeNet Network (Gradient-BasedLearning Applied to Document Recognition);
(2) Use./examples/mnist/lenet_train_test.prototxtmodel;
(3) Use./examples/mnist/lenet_solver.prototxtmodel;
(4) execute the train_lenet.sh script and call the caffe execution file under the./build/tools directory. The implementation of this execution file is the caffe. cpp file under the./tools directory;
(5) After the script is executed, several files are generated./examples/mnist/lenet_iter_assist.caffemodel is the model file generated during the final training;
(6) The above is run in GPU mode by default. To run it in CPU mode, you only need to change the solver_mode field value in the lenet_solver.prototxt file from the original GPU to the CPU;
The running result is as follows:
References: http://caffe.berkeleyvision.org/gathered/examples/mnist.html