From e8cc2e86e4495cec5b5aa469e4ca971621633762 Mon Sep 17 00:00:00 2001 From: p5tm2eri3 Date: Thu, 5 May 2022 17:44:56 +0800 Subject: [PATCH] Update README.md --- README.md | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/README.md b/README.md index 5cfe3b4..c4dcd66 100644 --- a/README.md +++ b/README.md @@ -108,17 +108,3 @@ model.evaluate(input_fn) # 预测单个图像 n_images = 6 -# 从数据集得到测试图像 -test_images = mnist.test.images[:n_images] -# 准备输入数据 -input_fn = tf.estimator.inputs.numpy_input_fn( - x={'images': test_images}, shuffle=False) -# 用训练好的模型预测图片类别 -preds = list(model.predict(input_fn)) - -# 可视化显示 -for i in range(n_images): - plt.imshow(np.reshape(test_images[i], [28, 28]), cmap='gray') - plt.show() - print("Model prediction:", preds[i]) -