http://mxnet.apache.org/api/python/gluon/data.html
import mxnet as mx from mxnet import nd,autograd,init,gluon from mxnet.gluon import data as gdata,loss as gloss,nn import numpy as np # gluon.data.vision的几类数据集 transform = lambda data,label: (data.astype(np.float32)/255,label) # train_mnist = mx.gluon.data.vision.MNIST(root='./tmp/mnist',transform=transform,train=True) # for X,y in train_mnist: # print(X) # print(y) # break # train_fashionmnist = mx.gluon.data.vision.FashionMNIST(root='./tmp/fashionmnist',transform=transform,train=True) # for X,y in train_fashionmnist: # print(X) # print(y) # break # train_cifar10 = mx.gluon.data.vision.CIFAR10(root='./tmp/cifar10',transform=transform,train=True) # for X,y in train_cifar10: # print(X) # print(y) # break # train_cifar100 = mx.gluon.data.vision.CIFAR100(root='./tmp/cifar100',transform=transform,train=True) # for X,y in train_cifar100: # print(X) # print(y) # break