tensorflow2.0 手写数字识别
import tensorflow as tf import matplotlib.pyplot as plt (x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() print(x_train.shape) print(y_train.shape) print(x_test.shape) print(y_test.shape) plt.figure(figsize=(12,12)) for i in range(36): plt.subplot(6,6,i+1) plt.xticks([]) plt.yticks([]) plt.grid(False) plt.imshow(x_train[i]) plt.xlabel(y_train[i]) plt.show()