Skip to content

Commit 2fddb92

Browse files
author
npanpaliya
authored
Merge pull request #2 from ibmsoe/examples_correction
Examples correction
2 parents 5a748a7 + 5ac567b commit 2fddb92

20 files changed

+146
-17
lines changed

examples/cifar10/create_cifar10.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,26 @@ EXAMPLE=examples/cifar10
55
DATA=data/cifar10
66
DBTYPE=lmdb
77

8+
# Check if CAFFE_BIN is set
9+
if [ -z ${CAFFE_BIN+x} ];
10+
# if unset
11+
then
12+
EXAMPLES=./build/$EXAMPLE
13+
TOOLS=./build/tools
14+
else
15+
EXAMPLES=$CAFFE_BIN
16+
TOOLS=$CAFFE_BIN
17+
fi
18+
819
echo "Creating $DBTYPE..."
920

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

12-
./build/examples/cifar10/convert_cifar_data.bin $DATA $EXAMPLE $DBTYPE
23+
$EXAMPLES/convert_cifar_data.bin $DATA $EXAMPLE $DBTYPE
1324

1425
echo "Computing image mean..."
1526

16-
./build/tools/compute_image_mean -backend=$DBTYPE \
27+
$TOOLS/compute_image_mean -backend=$DBTYPE \
1728
$EXAMPLE/cifar10_train_$DBTYPE $EXAMPLE/mean.binaryproto
1829

1930
echo "Done."

examples/cifar10/train_full.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env sh
22

3+
# Check if TOOLS is unset
4+
if [ -z ${TOOLS+x} ];
5+
then
36
TOOLS=./build/tools
7+
fi
48

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

examples/cifar10/train_full_sigmoid.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env sh
22

3+
# Check if TOOLS is unset
4+
if [ -z ${TOOLS+x} ];
5+
then
36
TOOLS=./build/tools
7+
fi
48

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

examples/cifar10/train_full_sigmoid_bn.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env sh
22

3+
# Check if TOOLS is unset
4+
if [ -z ${TOOLS+x} ];
5+
then
36
TOOLS=./build/tools
7+
fi
48

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

examples/cifar10/train_quick.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env sh
22

3+
# Check if TOOLS is unset
4+
if [ -z ${TOOLS+x} ];
5+
then
36
TOOLS=./build/tools
7+
fi
48

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

examples/imagenet/create_imagenet.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@
44

55
EXAMPLE=examples/imagenet
66
DATA=data/ilsvrc12
7-
TOOLS=build/tools
7+
8+
# Check if TOOLS is unset
9+
if [ -z ${TOOLS+x} ];
10+
then
11+
TOOLS=./build/tools
12+
fi
813

914
TRAIN_DATA_ROOT=/path/to/imagenet/train/
1015
VAL_DATA_ROOT=/path/to/imagenet/val/
@@ -36,6 +41,7 @@ fi
3641

3742
echo "Creating train lmdb..."
3843

44+
rm -rf $EXAMPLE/ilsvrc12_train_lmdb
3945
GLOG_logtostderr=1 $TOOLS/convert_imageset \
4046
--resize_height=$RESIZE_HEIGHT \
4147
--resize_width=$RESIZE_WIDTH \
@@ -46,6 +52,7 @@ GLOG_logtostderr=1 $TOOLS/convert_imageset \
4652

4753
echo "Creating val lmdb..."
4854

55+
rm -rf $EXAMPLE/ilsvrc12_val_lmdb
4956
GLOG_logtostderr=1 $TOOLS/convert_imageset \
5057
--resize_height=$RESIZE_HEIGHT \
5158
--resize_width=$RESIZE_WIDTH \

examples/imagenet/make_imagenet_mean.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44

55
EXAMPLE=examples/imagenet
66
DATA=data/ilsvrc12
7-
TOOLS=build/tools
7+
8+
# Check if TOOLS is unset
9+
if [ -z ${TOOLS+x} ];
10+
then
11+
TOOLS=./build/tools
12+
fi
13+
814

915
$TOOLS/compute_image_mean $EXAMPLE/ilsvrc12_train_lmdb \
1016
$DATA/imagenet_mean.binaryproto
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#!/usr/bin/env sh
22

3-
./build/tools/caffe train \
3+
# Check if TOOLS is unset
4+
if [ -z ${TOOLS+x} ];
5+
then
6+
TOOLS=./build/tools
7+
fi
8+
9+
$TOOLS/caffe train \
410
--solver=models/bvlc_reference_caffenet/solver.prototxt \
511
--snapshot=models/bvlc_reference_caffenet/caffenet_train_10000.solverstate.h5
Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/usr/bin/env sh
22

3-
./build/tools/caffe train \
3+
# Check if TOOLS is unset
4+
if [ -z ${TOOLS+x} ];
5+
then
6+
TOOLS=./build/tools
7+
fi
8+
9+
$TOOLS/caffe train \
410
--solver=models/bvlc_reference_caffenet/solver.prototxt

examples/mnist/create_mnist.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,15 @@
44

55
EXAMPLE=examples/mnist
66
DATA=data/mnist
7-
BUILD=build/examples/mnist
7+
8+
# Check if CAFFE_BIN is set
9+
if [ -z ${CAFFE_BIN+x} ];
10+
# if unset
11+
then
12+
BUILD=build/examples/mnist
13+
else
14+
BUILD=$CAFFE_BIN
15+
fi
816

917
BACKEND="lmdb"
1018

0 commit comments

Comments
 (0)