FashionMNIST¶
- class paddle.vision.datasets. FashionMNIST ( image_path=None, label_path=None, mode='train', transform=None, download=True, backend=None ) [source]
-
Implementation Fashion-MNIST dataset.
- Parameters
-
image_path (str) – path to image file, can be set None if
download
is True. Default Nonelabel_path (str) – path to label file, can be set None if
download
is True. Default Nonemode (str) – ‘train’ or ‘test’ mode. Default ‘train’.
download (bool) – whether to download dataset automatically if
image_path
label_path
is not set. Default Truebackend (str, optional) – Specifies which type of image to be returned: PIL.Image or numpy.ndarray. Should be one of {‘pil’, ‘cv2’}. If this option is not set, will get backend from
paddle.vsion.get_image_backend
, default backend is ‘pil’. Default: None.
- Returns
-
Fashion-MNIST Dataset.
- Return type
-
Dataset
Examples
from paddle.vision.datasets import FashionMNIST mnist = FashionMNIST(mode='test') for i in range(len(mnist)): sample = mnist[i] print(sample[0].size, sample[1])