Skip to content

Commit

Permalink
bring mnist docs back to reality
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Feb 26, 2014
1 parent 026ccd7 commit cd6df9e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
12 changes: 7 additions & 5 deletions docs/mnist.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ Prepare Datasets

You will first need to download and convert the data format from the MNIST website. To do this, simply run the following commands:

cd $CAFFE_ROOT/data
cd $CAFFE_ROOT/data/mnist
./get_mnist.sh
cd $CAFFE_ROOT/examples/lenet
./create_mnist.sh

If it complains that `wget` or `gunzip` are not installed, you need to install them respectively. After running the script there should be two datasets, `CAFFE_ROOT/data/mnist-train-leveldb`, and `CAFFE_ROOT/data/mnist-test-leveldb`.

Expand All @@ -31,10 +33,10 @@ Training and Testing the Model

Training the model is simple after you have written the network definition protobuf and solver protobuf files. Simply run `train_mnist.sh`, or the following command directly:

cd $CAFFE_ROOT/data
GLOG_logtostderr=1 ../examples/train_net.bin lenet_solver.prototxt
cd $CAFFE_ROOT/examples/lenet
./train_lenet.sh

A few explanations: `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main executable for training is `examples/train_net.bin`, with the solver protobuf text file as its argument.
`train_lenet.sh` is a simple script, but here are a few explanations: `GLOG_logtostderr=1` is the google logging flag that prints all the logging messages directly to stderr. The main tool for training is `train_net.bin`, with the solver protobuf text file as its argument.

When you run the code, you will see a lot of messages flying by like this:

Expand Down Expand Up @@ -79,7 +81,7 @@ which you can deploy as a trained model in your application, if you are training
Um... How about GPU training?
-----------------------------

You just did! All the training were carried out on the GPU. In fact, if you would like to do training on CPU, you can simply change one line in `lenet_solver.prototxt`:
You just did! All the training was carried out on the GPU. In fact, if you would like to do training on CPU, you can simply change one line in `lenet_solver.prototxt`:

# solver mode: 0 for CPU and 1 for GPU
solver_mode: 0
Expand Down
2 changes: 1 addition & 1 deletion docs/mnist_prototxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Caffe
Define the MNIST Network
=========================

This page explains the prototxt file used in the MNIST demo. We assume that you are familiar with [Google Protobuf](https://developers.google.com/protocol-buffers/docs/overview), and assume that you have read the protobuf definitions used by Caffe, which can be found at [src/caffe/proto/caffe.proto](https://github.com/Yangqing/caffe/blob/master/src/caffe/proto/caffe.proto).
This page explains the prototxt file `lenet_train.prototxt` used in the MNIST demo. We assume that you are familiar with [Google Protobuf](https://developers.google.com/protocol-buffers/docs/overview), and assume that you have read the protobuf definitions used by Caffe, which can be found at [src/caffe/proto/caffe.proto](https://github.com/Yangqing/caffe/blob/master/src/caffe/proto/caffe.proto).

Specifically, we will write a `caffe::NetParameter` (or in python, `caffe.proto.caffe_pb2.NetParameter`) protubuf. We will start by giving the network a name:

Expand Down
2 changes: 1 addition & 1 deletion docs/mnist_solver_prototxt.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Define the MNIST Solver
The page is under construction. For now, check out the comments in the solver prototxt file, which explains each line in the prototxt:

# The training protocol buffer definition
train_net: "lenet.prototxt"
train_net: "lenet_train.prototxt"
# The testing protocol buffer definition
test_net: "lenet_test.prototxt"
# test_iter specifies how many forward passes the test should carry out.
Expand Down

0 comments on commit cd6df9e

Please sign in to comment.