Add script to speedtest imagenet (currently broken as FilterNet ignores
authorJeff Donahue <jeff.donahue@gmail.com>
Sat, 2 Aug 2014 20:17:09 +0000 (13:17 -0700)
committerJeff Donahue <jeff.donahue@gmail.com>
Sat, 2 Aug 2014 20:28:46 +0000 (13:28 -0700)
Caffe::phase()).

examples/imagenet/speedtest_imagenet.sh [new file with mode: 0755]

diff --git a/examples/imagenet/speedtest_imagenet.sh b/examples/imagenet/speedtest_imagenet.sh
new file mode 100755 (executable)
index 0000000..c790d83
--- /dev/null
@@ -0,0 +1,22 @@
+#!/usr/bin/env sh
+
+TOOLS=../../build/tools
+
+if [ -z "$1" ]; then
+  echo "Using CPU! To run GPU speedtest, use:"
+  echo "    ./speedtest_imagenet.sh <device ID>"
+  echo "(Try ./speedtest_imagenet.sh 0 if you have just one GPU.)"
+  sleep 3  # Let the user read
+  WITH_GPU=false
+  DEVICE_ID=0
+else
+  WITH_GPU=true
+  DEVICE_ID=$1
+fi
+
+GLOG_logtostderr=1 $TOOLS/caffe.bin speedtest \
+  --net_proto_file=imagenet_train_val.prototxt \
+  --speedtest_with_gpu=${WITH_GPU} \
+  --device_id=${DEVICE_ID}
+
+echo "Done."