Skip to content

Commit b38343e

Browse files
authored
Merge pull request #390 from 9bow/master
some improvements to the make download(#384)
2 parents d87425a + b037aef commit b38343e

File tree

1 file changed

+35
-23
lines changed

1 file changed

+35
-23
lines changed

Makefile

Lines changed: 35 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ SPHINXBUILD = sphinx-build
1010
SPHINXPROJ = PyTorchTutorials
1111
SOURCEDIR = .
1212
BUILDDIR = _build
13+
DATADIR = _data
1314
GH_PAGES_SOURCES = $(SOURCEDIR) Makefile
1415

1516
# Put it first so that "make" without argument is like "make help".
@@ -27,47 +28,58 @@ download:
2728
# IMPORTANT NOTE: Please make sure your dataset is downloaded to *_source/data folder,
2829
# otherwise CI might silently break.
2930

31+
# NOTE: Please consider using the Step1 and one of Step2 for new dataset,
32+
# [something] should be replaced with the actual value.
33+
# Step1. DOWNLOAD: wget -N [SOURCE_FILE] -P $(DATADIR)
34+
# Step2-1. UNZIP: unzip -o $(DATADIR)/[SOURCE_FILE] -d [*_source/data/]
35+
# Step2-2. UNTAR: tar -xzf $(DATADIR)/[SOURCE_FILE] -C [*_source/data/]
36+
# Step2-3. AS-IS: cp $(DATADIR)/[SOURCE_FILE] [*_source/data/]
37+
38+
# make data directories
39+
mkdir -p $(DATADIR)
40+
mkdir -p advanced_source/data
41+
mkdir -p beginner_source/data
42+
mkdir -p intermediate_source/data
43+
3044
# transfer learning tutorial data
31-
wget -N https://download.pytorch.org/tutorial/hymenoptera_data.zip
32-
unzip -o hymenoptera_data.zip -d beginner_source/data
33-
45+
wget -N https://download.pytorch.org/tutorial/hymenoptera_data.zip -P $(DATADIR)
46+
unzip -o $(DATADIR)/hymenoptera_data.zip -d beginner_source/data/
47+
3448
# nlp tutorial data
35-
wget -N https://download.pytorch.org/tutorial/data.zip
36-
unzip -o data.zip -d intermediate_source/ # This will unzip all files in data.zip to intermediate_source/data/ folder
37-
49+
wget -N https://download.pytorch.org/tutorial/data.zip -P $(DATADIR)
50+
unzip -o $(DATADIR)/data.zip -d intermediate_source/ # This will unzip all files in data.zip to intermediate_source/data/ folder
51+
3852
# data loader tutorial
39-
wget -N https://download.pytorch.org/tutorial/faces.zip
40-
unzip -o faces.zip -d beginner_source/data
53+
wget -N https://download.pytorch.org/tutorial/faces.zip -P $(DATADIR)
54+
unzip -o $(DATADIR)/faces.zip -d beginner_source/data/
55+
56+
wget -N https://download.pytorch.org/models/tutorials/4000_checkpoint.tar -P $(DATADIR)
57+
cp $(DATADIR)/4000_checkpoint.tar beginner_source/data/
4158

42-
wget -N https://download.pytorch.org/models/tutorials/4000_checkpoint.tar
43-
cp 4000_checkpoint.tar beginner_source/data
44-
4559
# neural style images
4660
rm -rf advanced_source/data/images/ || true
4761
mkdir -p advanced_source/data/images/
4862
cp -r _static/img/neural-style/ advanced_source/data/images/
4963

5064
# Download dataset for beginner_source/dcgan_faces_tutorial.py
51-
curl https://s3.amazonaws.com/pytorch-tutorial-assets/img_align_celeba.zip --output img_align_celeba.zip
52-
sudo mkdir -p beginner_source/data/celeba
53-
sudo chmod -R 0777 beginner_source/data/celeba
54-
unzip img_align_celeba.zip -d beginner_source/data/celeba > null
65+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/img_align_celeba.zip -P $(DATADIR)
66+
unzip -q -o $(DATADIR)/img_align_celeba.zip -d beginner_source/data/celeba
5567

5668
# Download dataset for beginner_source/hybrid_frontend/introduction_to_hybrid_frontend_tutorial.py
57-
mkdir data/
58-
curl https://s3.amazonaws.com/pytorch-tutorial-assets/iris.data --output beginner_source/data/iris.data
69+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/iris.data -P $(DATADIR)
70+
cp $(DATADIR)/iris.data beginner_source/data/
5971

6072
# Download dataset for beginner_source/chatbot_tutorial.py
61-
curl https://s3.amazonaws.com/pytorch-tutorial-assets/cornell_movie_dialogs_corpus.zip --output cornell_movie_dialogs_corpus.zip
62-
mkdir -p beginner_source/data
63-
unzip cornell_movie_dialogs_corpus.zip -d beginner_source/data/ > null
73+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/cornell_movie_dialogs_corpus.zip -P $(DATADIR)
74+
unzip -q -o $(DATADIR)/cornell_movie_dialogs_corpus.zip -d beginner_source/data/
6475

6576
# Download dataset for beginner_source/audio_classifier_tutorial.py
66-
curl https://s3.amazonaws.com/pytorch-tutorial-assets/UrbanSound8K.tar.gz --output UrbanSound8K.tar.gz
67-
tar -xzf UrbanSound8K.tar.gz -C ./beginner_source/data
77+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/UrbanSound8K.tar.gz -P $(DATADIR)
78+
tar -xzf $(DATADIR)/UrbanSound8K.tar.gz -C ./beginner_source/data/
6879

6980
# Download model for beginner_source/fgsm_tutorial.py
70-
curl https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model.pth --output ./beginner_source/data/lenet_mnist_model.pth
81+
wget -N https://s3.amazonaws.com/pytorch-tutorial-assets/lenet_mnist_model.pth -P $(DATADIR)
82+
cp $(DATADIR)/lenet_mnist_model.pth ./beginner_source/data/lenet_mnist_model.pth
7183

7284
docs:
7385
make download

0 commit comments

Comments
 (0)