get_mnist_data.sh 473 字节
Newer Older
1
#!/usr/bin/env sh
2
# This script downloads the mnist data and unzips it.
3 4
set -e
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
5 6 7
rm -rf "$DIR/mnist_data"
mkdir "$DIR/mnist_data"
cd "$DIR/mnist_data"
8 9 10 11 12 13 14 15 16 17

echo "Downloading..."

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