Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions examples/cifar10/create_cifar10.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,26 @@ EXAMPLE=examples/cifar10
DATA=data/cifar10
DBTYPE=lmdb

# Check if CAFFE_BIN is set
if [ -z ${CAFFE_BIN+x} ];
# if unset
then
EXAMPLES=./build/$EXAMPLE
TOOLS=./build/tools
else
EXAMPLES=$CAFFE_BIN
TOOLS=$CAFFE_BIN
fi

echo "Creating $DBTYPE..."

rm -rf $EXAMPLE/cifar10_train_$DBTYPE $EXAMPLE/cifar10_test_$DBTYPE

./build/examples/cifar10/convert_cifar_data.bin $DATA $EXAMPLE $DBTYPE
$EXAMPLES/convert_cifar_data.bin $DATA $EXAMPLE $DBTYPE

echo "Computing image mean..."

./build/tools/compute_image_mean -backend=$DBTYPE \
$TOOLS/compute_image_mean -backend=$DBTYPE \
$EXAMPLE/cifar10_train_$DBTYPE $EXAMPLE/mean.binaryproto

echo "Done."
4 changes: 4 additions & 0 deletions examples/cifar10/train_full.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env sh

# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver.prototxt
Expand Down
4 changes: 4 additions & 0 deletions examples/cifar10/train_full_sigmoid.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env sh

# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_sigmoid_solver.prototxt
Expand Down
4 changes: 4 additions & 0 deletions examples/cifar10/train_full_sigmoid_bn.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env sh

# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt
Expand Down
4 changes: 4 additions & 0 deletions examples/cifar10/train_quick.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#!/usr/bin/env sh

# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_quick_solver.prototxt
Expand Down
9 changes: 8 additions & 1 deletion examples/imagenet/create_imagenet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@

EXAMPLE=examples/imagenet
DATA=data/ilsvrc12
TOOLS=build/tools

# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

TRAIN_DATA_ROOT=/path/to/imagenet/train/
VAL_DATA_ROOT=/path/to/imagenet/val/
Expand Down Expand Up @@ -36,6 +41,7 @@ fi

echo "Creating train lmdb..."

rm -rf $EXAMPLE/ilsvrc12_train_lmdb
GLOG_logtostderr=1 $TOOLS/convert_imageset \
--resize_height=$RESIZE_HEIGHT \
--resize_width=$RESIZE_WIDTH \
Expand All @@ -46,6 +52,7 @@ GLOG_logtostderr=1 $TOOLS/convert_imageset \

echo "Creating val lmdb..."

rm -rf $EXAMPLE/ilsvrc12_val_lmdb
GLOG_logtostderr=1 $TOOLS/convert_imageset \
--resize_height=$RESIZE_HEIGHT \
--resize_width=$RESIZE_WIDTH \
Expand Down
8 changes: 7 additions & 1 deletion examples/imagenet/make_imagenet_mean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@

EXAMPLE=examples/imagenet
DATA=data/ilsvrc12
TOOLS=build/tools

# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi


$TOOLS/compute_image_mean $EXAMPLE/ilsvrc12_train_lmdb \
$DATA/imagenet_mean.binaryproto
Expand Down
8 changes: 7 additions & 1 deletion examples/imagenet/resume_training.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env sh

./build/tools/caffe train \
# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=models/bvlc_reference_caffenet/solver.prototxt \
--snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5
8 changes: 7 additions & 1 deletion examples/imagenet/train_caffenet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env sh

./build/tools/caffe train \
# Check if TOOLS is unset
if [ -z ${TOOLS+x} ];
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=models/bvlc_reference_caffenet/solver.prototxt
10 changes: 9 additions & 1 deletion examples/mnist/create_mnist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@

EXAMPLE=examples/mnist
DATA=data/mnist
BUILD=build/examples/mnist

# Check if CAFFE_BIN is set
if [ -z ${CAFFE_BIN+x} ];
# if unset
then
BUILD=build/examples/mnist
else
BUILD=$CAFFE_BIN
fi

BACKEND="lmdb"

Expand Down
9 changes: 8 additions & 1 deletion examples/mnist/train_lenet.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env sh

./build/tools/caffe train --solver=examples/mnist/lenet_solver.prototxt
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train --solver=examples/mnist/lenet_solver.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_lenet_adam.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env sh

./build/tools/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_lenet_consolidated.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env sh

./build/tools/caffe train \
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/mnist/lenet_consolidated_solver.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_lenet_rmsprop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env sh

./build/tools/caffe train --solver=examples/mnist/lenet_solver_rmsprop.prototxt
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train --solver=examples/mnist/lenet_solver_rmsprop.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_mnist_autoencoder.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/usr/bin/env sh

./build/tools/caffe train \
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_mnist_autoencoder_adadelta.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash

./build/tools/caffe train \
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_adadelta.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_mnist_autoencoder_adagrad.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash

./build/tools/caffe train \
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_adagrad.prototxt
9 changes: 8 additions & 1 deletion examples/mnist/train_mnist_autoencoder_nesterov.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash

./build/tools/caffe train \
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_nesterov.prototxt
10 changes: 9 additions & 1 deletion examples/siamese/create_mnist_siamese.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
#!/usr/bin/env sh
# This script converts the mnist data into leveldb format.

EXAMPLES=./build/examples/siamese
DATA=./data/mnist

# Check if CAFFE_BIN is set
if [ -z ${CAFFE_BIN+x} ];
# if unset
then
EXAMPLES=./build/examples/siamese
else
EXAMPLES=$CAFFE_BIN
fi

echo "Creating leveldb..."

rm -rf ./examples/siamese/mnist_siamese_train_leveldb
Expand Down
7 changes: 6 additions & 1 deletion examples/siamese/train_mnist_siamese.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env sh

TOOLS=./build/tools
# Check if TOOLS is set
if [ -z ${TOOLS+x} ];
# if unset
then
TOOLS=./build/tools
fi

$TOOLS/caffe train --solver=examples/siamese/mnist_siamese_solver.prototxt