image_output_2.png image_output_1.png
import matplotlib.pyplot as plt

import numpy as np

def show_image(image):
    plt.figure()
    plt.imshow(image)
    plt.colorbar()
    plt.grid(False)
    plt.show()
imagenum = np.random.randint(len(x_train))
show_image(x_train[imagenum].reshape(32, 32, 3))
classes = ['airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck']
print('Class:', classes[int(y_train[imagenum])])