- 数据准备
直接从github上下载数据:
将数据放置在~/.mxnet/datasets/fashion-mnist/文件夹下。 - 获取sha
个人觉得最简单的办法是修改:/path/mxnet/gluon/utils.py的download函数
if not verify_ssl:
warnings.warn(
'Unverified HTTPS request is being made (verify_ssl=False). '
'Adding certificate verification is strongly advised.')
sha1 = hashlib.sha1()
with open(fname, 'rb') as f:
while True:
data = f.read(1048576)
if not data:
break
sha1.update(data)
print('hash name', sha1.hexdigest())
将输出的hash值填入到/path/mxnet/gluon/data/vision/datasets.py的FashionMNIST函数
中即可:
self._train_data = ('train-images-idx3-ubyte.gz',
'95978b76b6897f6ca69a25145d01716efb615989')
self._train_label = ('train-labels-idx1-ubyte.gz',
'09814cfef5a041118ceace42f8dae995319d331a')
self._test_data = ('t10k-images-idx3-ubyte.gz',
'5edda96c6d8c36ff915115a0e8136d370a021576')
self._test_label = ('t10k-labels-idx1-ubyte.gz',
'9caad14e1aff9adac77d3744963212d36af15bee')