|
20 | 20 | import cPickle
|
21 | 21 | import itertools
|
22 | 22 | import numpy
|
23 |
| -import paddle.v2.dataset.common |
| 23 | +from common import download |
24 | 24 | import tarfile
|
25 | 25 |
|
26 | 26 | __all__ = ['train100', 'test100', 'train10', 'test10']
|
@@ -55,28 +55,23 @@ def reader():
|
55 | 55 |
|
56 | 56 | def train100():
|
57 | 57 | return reader_creator(
|
58 |
| - paddle.v2.dataset.common.download(CIFAR100_URL, 'cifar', CIFAR100_MD5), |
59 |
| - 'train') |
| 58 | + download(CIFAR100_URL, 'cifar', CIFAR100_MD5), 'train') |
60 | 59 |
|
61 | 60 |
|
62 | 61 | def test100():
|
63 |
| - return reader_creator( |
64 |
| - paddle.v2.dataset.common.download(CIFAR100_URL, 'cifar', CIFAR100_MD5), |
65 |
| - 'test') |
| 62 | + return reader_creator(download(CIFAR100_URL, 'cifar', CIFAR100_MD5), 'test') |
66 | 63 |
|
67 | 64 |
|
68 | 65 | def train10():
|
69 | 66 | return reader_creator(
|
70 |
| - paddle.v2.dataset.common.download(CIFAR10_URL, 'cifar', CIFAR10_MD5), |
71 |
| - 'data_batch') |
| 67 | + download(CIFAR10_URL, 'cifar', CIFAR10_MD5), 'data_batch') |
72 | 68 |
|
73 | 69 |
|
74 | 70 | def test10():
|
75 | 71 | return reader_creator(
|
76 |
| - paddle.v2.dataset.common.download(CIFAR10_URL, 'cifar', CIFAR10_MD5), |
77 |
| - 'test_batch') |
| 72 | + download(CIFAR10_URL, 'cifar', CIFAR10_MD5), 'test_batch') |
78 | 73 |
|
79 | 74 |
|
80 |
| -def fetch_data(): |
81 |
| - paddle.v2.dataset.common.download(CIFAR10_URL, 'cifar', CIFAR10_MD5) |
82 |
| - paddle.v2.dataset.common.download(CIFAR100_URL, 'cifar', CIFAR100_MD5) |
| 75 | +def fetch(): |
| 76 | + download(CIFAR10_URL, 'cifar', CIFAR10_MD5) |
| 77 | + download(CIFAR100_URL, 'cifar', CIFAR100_MD5) |
0 commit comments