fashionmnist数据集下载
时间: 2023-08-30 21:08:03 浏览: 168
Fashion-MNIST数据集可以通过多种方式进行下载。基于Python语言的下载方法可以使用utils/mnist_reader库来下载,具体代码如下:
```
import mnist_reader
X_train, y_train = mnist_reader.load_mnist('data/fashion', kind='train')
X_test, y_test = mnist_reader.load_mnist('data/fashion', kind='t10k')
```
基于Tensorflow的下载方法可以使用tensorflow.examples.tutorials.mnist库来下载,具体代码如下:
```
from tensorflow.examples.tutorials.mnist import input_data
data = input_data.read_data_sets('data/fashion')
data.train.next_batch(BATCH_SIZE)
```
另外,你也可以手动下载FashionMNIST数据集。具体代码如下:
```
import torchvision.datasets as datasets
import torchvision.transforms as transforms
transform = transforms.ToTensor()
fashion_train = datasets.FashionMNIST(root=r'G:\D2L\fashion_mnist', train=True, download=True, transform=transform)
fashion_test = datasets.FashionMNIST(root=r'G:\D2L\fashion_mnist', train=False, download=True, transform=transform)
```
以上是三种常用的下载Fashion-MNIST数据集的方法。你可以根据自己的需求选择其中一种方法进行下载。
#### 引用[.reference_title]
- *1* *2* [Dataset之Fashion-MNIST:Fashion-MNIST数据集简介与下载](https://blog.csdn.net/qq_46092061/article/details/119617811)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [FashionMNIST数据下载和显示数据](https://blog.csdn.net/weixin_45146080/article/details/123694164)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文