diff --git a/data/mnist/get_mnist.sh b/data/mnist/get_mnist.sh index 8eb6aeedf9f..6d875219489 100755 --- a/data/mnist/get_mnist.sh +++ b/data/mnist/get_mnist.sh @@ -6,19 +6,10 @@ cd $DIR echo "Downloading..." -wget --no-check-certificate http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz -wget --no-check-certificate http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz -wget --no-check-certificate http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz -wget --no-check-certificate http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz - -echo "Unzipping..." - -gunzip train-images-idx3-ubyte.gz -gunzip train-labels-idx1-ubyte.gz -gunzip t10k-images-idx3-ubyte.gz -gunzip t10k-labels-idx1-ubyte.gz - -# Creation is split out because leveldb sometimes causes segfault -# and needs to be re-created. - -echo "Done." +for fname in train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte +do + if [ ! -e $fname ]; then + wget --no-check-certificate http://yann.lecun.com/exdb/mnist/${fname}.gz + gunzip ${fname}.gz + fi +done