how to load fashion mnist dataset code example
Example 1: how to display the first 25 images from training dataset
plt.figure(figsize=(10,10))for i in range(25): plt.subplot(5,5,i+1) plt.xticks([]) plt.yticks([]) plt.grid(False) plt.imshow(train_images[i], cmap=plt.cm.binary) plt.xlabel(class_names[train_labels[i]])plt.show()
Example 2: mnist fashion dataset
import tensorflow as tf
from tensorflow.keras.datasets import fashion_mnist
link - https://github.com/zalandoresearch/fashion-mnist
(train_data, train_labels), (test_data, test_labels) = fashion_mnist.load_data()
class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', 'Sandle', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot']