get_mnist_data.sh 514 字节
Newer Older
W
wangyang59 已提交
1 2
#!/usr/bin/env sh
# This scripts downloads the mnist data and unzips it.
3
set -e
W
wangyang59 已提交
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
rm -rf "$DIR/raw_data"
mkdir "$DIR/raw_data"
cd "$DIR/raw_data"

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

cd $DIR
rm -f *.list
python generate_list.py