Skip to content

Commit

Permalink
Merge pull request BVLC#242 from kloudkl/script
Browse files Browse the repository at this point in the history
Fix shell scripts: current dir, wget output, and naming conventions
  • Loading branch information
shelhamer committed Mar 19, 2014
2 parents ade96f1 + 2ac5785 commit ee0b50a
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions data/cifar10/get_cifar10.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#!/usr/bin/env sh
# This scripts downloads the CIFAR10 (binary version) data and unzips it.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(readlink -f $(dirname "$0"))"
cd $DIR

echo "Downloading..."

wget -q http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz
wget http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz

echo "Unzipping..."

Expand Down
4 changes: 2 additions & 2 deletions data/ilsvrc12/get_ilsvrc_aux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
# - synset ids and words
# - the training splits with labels

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(readlink -f $(dirname "$0"))"
cd $DIR

echo "Downloading..."

wget -q https://www.dropbox.com/s/g5myor4y2scdv95/caffe_ilsvrc12.tar.gz
wget https://www.dropbox.com/s/g5myor4y2scdv95/caffe_ilsvrc12.tar.gz

echo "Unzipping..."

Expand Down
10 changes: 5 additions & 5 deletions data/mnist/get_mnist.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#!/usr/bin/env sh
# This scripts downloads the mnist data and unzips it.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(readlink -f $(dirname "$0"))"
cd $DIR

echo "Downloading..."

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
wget http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
wget http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
wget http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
wget http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz

echo "Unzipping..."

Expand Down
2 changes: 1 addition & 1 deletion scripts/build_and_deploy_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ MSG=`git log --oneline -1`

if [[ $BRANCH = 'master' ]]; then
# Find the docs dir, no matter where the script is called
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(readlink -f $(dirname "$0"))"
DOCS_SITE_DIR=$DIR/../docs/_site

# Make sure that docs/_site tracks remote:gh-pages.
Expand Down
6 changes: 3 additions & 3 deletions tools/extra/parselog.sh → tools/extra/parse_log.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
# Usage parselog.sh caffe.log
# Usage parse_log.sh caffe.log
# It creates two files one caffe.log.test that contains the loss and test accuracy of the test and
# another one caffe.log.loss that contains the loss computed during the training

#get the dirname of the script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
DIR="$(readlink -f $(dirname "$0"))"

if [ "$#" -lt 1 ]
then
echo "Usage parselog.sh /path/to/your.log"
echo "Usage parse_log.sh /path/to/your.log"
exit
fi
LOG=`basename $1`
Expand Down
4 changes: 2 additions & 2 deletions tools/extra/plot_log.gnuplot.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
# You had better check the data files before designing your own plots.

# Please generate the neccessary data files with
# /path/to/caffe/scripts/parselog.sh before plotting.
# /path/to/caffe/scripts/parse_log.sh before plotting.
# Example usage:
# ./parselog.sh mnist.log
# ./parse_log.sh mnist.log
# Now you have mnist.log.train and mnist.log.test.
# gnuplot mnist.gnuplot

Expand Down
2 changes: 1 addition & 1 deletion tools/extra/plot_training_log.py.example
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import matplotlib.markers as mks

def get_log_parsing_script():
dirname = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
return dirname + '/parselog.sh'
return dirname + '/parse_log.sh'

def get_log_file_suffix():
return '.log'
Expand Down

0 comments on commit ee0b50a

Please sign in to comment.