Skip to content

Commit

Permalink
Add "set -e" and $@ to example scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeyeager committed Jul 13, 2016
1 parent c2a1ecd commit 93d3212
Show file tree
Hide file tree
Showing 19 changed files with 39 additions and 18 deletions.
1 change: 1 addition & 0 deletions examples/cifar10/create_cifar10.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
# This script converts the cifar data into leveldb format.
set -e

EXAMPLE=examples/cifar10
DATA=data/cifar10
Expand Down
7 changes: 4 additions & 3 deletions examples/cifar10/train_full.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver.prototxt
--solver=examples/cifar10/cifar10_full_solver.prototxt $@

# reduce learning rate by factor of 10
$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver_lr1.prototxt \
--snapshot=examples/cifar10/cifar10_full_iter_60000.solverstate.h5
--snapshot=examples/cifar10/cifar10_full_iter_60000.solverstate.h5 $@

# reduce learning rate by factor of 10
$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_solver_lr2.prototxt \
--snapshot=examples/cifar10/cifar10_full_iter_65000.solverstate.h5
--snapshot=examples/cifar10/cifar10_full_iter_65000.solverstate.h5 $@
3 changes: 2 additions & 1 deletion examples/cifar10/train_full_sigmoid.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_sigmoid_solver.prototxt
--solver=examples/cifar10/cifar10_full_sigmoid_solver.prototxt $@

3 changes: 2 additions & 1 deletion examples/cifar10/train_full_sigmoid_bn.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt
--solver=examples/cifar10/cifar10_full_sigmoid_solver_bn.prototxt $@

5 changes: 3 additions & 2 deletions examples/cifar10/train_quick.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_quick_solver.prototxt
--solver=examples/cifar10/cifar10_quick_solver.prototxt $@

# reduce learning rate by factor of 10 after 8 epochs
$TOOLS/caffe train \
--solver=examples/cifar10/cifar10_quick_solver_lr1.prototxt \
--snapshot=examples/cifar10/cifar10_quick_iter_4000.solverstate.h5
--snapshot=examples/cifar10/cifar10_quick_iter_4000.solverstate.h5 $@
1 change: 1 addition & 0 deletions examples/imagenet/create_imagenet.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
# Create the imagenet lmdb inputs
# N.B. set the path to the imagenet train + val data dirs
set -e

EXAMPLE=examples/imagenet
DATA=data/ilsvrc12
Expand Down
4 changes: 3 additions & 1 deletion examples/imagenet/resume_training.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=models/bvlc_reference_caffenet/solver.prototxt \
--snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5
--snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5 \
$@
3 changes: 2 additions & 1 deletion examples/imagenet/train_caffenet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=models/bvlc_reference_caffenet/solver.prototxt
--solver=models/bvlc_reference_caffenet/solver.prototxt $@
1 change: 1 addition & 0 deletions examples/mnist/create_mnist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env sh
# This script converts the mnist data into lmdb/leveldb format,
# depending on the value assigned to $BACKEND.
set -e

EXAMPLE=examples/mnist
DATA=data/mnist
Expand Down
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train --solver=examples/mnist/lenet_solver.prototxt
./build/tools/caffe train --solver=examples/mnist/lenet_solver.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet_adam.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt
./build/tools/caffe train --solver=examples/mnist/lenet_solver_adam.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_lenet_consolidated.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=examples/mnist/lenet_consolidated_solver.prototxt
--solver=examples/mnist/lenet_consolidated_solver.prototxt $@
4 changes: 3 additions & 1 deletion examples/mnist/train_lenet_rmsprop.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train --solver=examples/mnist/lenet_solver_rmsprop.prototxt
./build/tools/caffe train \
--solver=examples/mnist/lenet_solver_rmsprop.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver.prototxt
--solver=examples/mnist/mnist_autoencoder_solver.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder_adadelta.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_adadelta.prototxt
--solver=examples/mnist/mnist_autoencoder_solver_adadelta.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder_adagrad.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_adagrad.prototxt
--solver=examples/mnist/mnist_autoencoder_solver_adagrad.prototxt $@
3 changes: 2 additions & 1 deletion examples/mnist/train_mnist_autoencoder_nesterov.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
set -e

./build/tools/caffe train \
--solver=examples/mnist/mnist_autoencoder_solver_nesterov.prototxt
--solver=examples/mnist/mnist_autoencoder_solver_nesterov.prototxt $@
1 change: 1 addition & 0 deletions examples/siamese/create_mnist_siamese.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
# This script converts the mnist data into leveldb format.
set -e

EXAMPLES=./build/examples/siamese
DATA=./data/mnist
Expand Down
3 changes: 2 additions & 1 deletion examples/siamese/train_mnist_siamese.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env sh
set -e

TOOLS=./build/tools

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

0 comments on commit 93d3212

Please sign in to comment.