Skip to content

Commit

Permalink
file mnist
Browse files Browse the repository at this point in the history
  • Loading branch information
shelhamer committed Feb 26, 2014
1 parent b09adf7 commit 650b7b1
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 5 deletions.
3 changes: 0 additions & 3 deletions data/train_mnist.sh

This file was deleted.

14 changes: 14 additions & 0 deletions examples/create_mnist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh
# This script converts the mnist data into leveldb format.

cd ../data

echo "Creating leveldb..."

rm -rf mnist-train-leveldb
rm -rf mnist-test-leveldb

../build/examples/convert_mnist_data.bin train-images-idx3-ubyte train-labels-idx1-ubyte mnist-train-leveldb
../build/examples/convert_mnist_data.bin t10k-images-idx3-ubyte t10k-labels-idx1-ubyte mnist-test-leveldb

echo "Done."
23 changes: 23 additions & 0 deletions examples/get_mnist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env sh
# This scripts downloads the mnist data and unzips it.

echo "Downloading data..."

cd ../data

wget -q http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
wget -q http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
wget -q http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
wget -q http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz

echo "Unzipping..."

gunzip train-images-idx3-ubyte.gz
gunzip train-labels-idx1-ubyte.gz
gunzip t10k-images-idx3-ubyte.gz
gunzip t10k-labels-idx1-ubyte.gz

# Creation is split out because leveldb sometimes causes segfault
# and needs to be re-created.

echo "Done."
2 changes: 1 addition & 1 deletion data/lenet.prototxt → examples/lenet.prototxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layers {
layer {
name: "mnist"
type: "data"
source: "mnist-train-leveldb"
source: "../data/mnist-train-leveldb"
batchsize: 64
scale: 0.00390625
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion data/lenet_test.prototxt → examples/lenet_test.prototxt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layers {
layer {
name: "mnist"
type: "data"
source: "mnist-test-leveldb"
source: "../data/mnist-test-leveldb"
batchsize: 100
scale: 0.00390625
}
Expand Down
3 changes: 3 additions & 0 deletions examples/train_mnist.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

GLOG_logtostderr=1 ../build/tools/train_net.bin ../models/lenet_solver.prototxt

0 comments on commit 650b7b1

Please sign in to comment.