generated from nogibjj/rust-pytorch-gpu-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload-mnist.sh
executable file
·29 lines (29 loc) · 878 Bytes
/
load-mnist.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
# Load the MNIST dataset into a data directory
# Usage: load-mnist.sh <data-dir>
# Example: load-mnist.sh data
set -e
if [ "$#" -ne 1 ]; then
echo "Usage: load-mnist.sh <data-dir>"
exit 1
fi
DATA_DIR=$1
mkdir -p $DATA_DIR
cd $DATA_DIR
if [ ! -f train-images-idx3-ubyte.gz ]; then
wget http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
fi
if [ ! -f train-labels-idx1-ubyte.gz ]; then
wget http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
fi
if [ ! -f t10k-images-idx3-ubyte.gz ]; then
wget http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
fi
if [ ! -f t10k-labels-idx1-ubyte.gz ]; then
wget http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
fi
gunzip -f train-images-idx3-ubyte.gz
gunzip -f train-labels-idx1-ubyte.gz
gunzip -f t10k-images-idx3-ubyte.gz
gunzip -f t10k-labels-idx1-ubyte.gz
cd -