FashionMNIST¶
- class torchvision.datasets.FashionMNIST(root: Union[str, Path], train: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)[source]¶
Fashion-MNIST 数据集。
- 参数:
root (str 或
pathlib.Path
):数据集的根目录,其中包含FashionMNIST/raw/train-images-idx3-ubyte
和FashionMNIST/raw/t10k-images-idx3-ubyte
。train (bool, optional):如果为 True,则从
train-images-idx3-ubyte
创建数据集,否则从t10k-images-idx3-ubyte
创建。transform (callable, optional):一个函数/变换,接受 PIL 图像并返回转换后的版本。例如,
transforms.RandomCrop
target_transform (callable, optional):一个函数/变换,接受目标并对其进行转换。
download (bool, optional):如果为 True,则从互联网下载数据集并将其放入根目录。如果数据集已下载,则不会再次下载。
- 特殊成员: