训练MNIST数据集后该怎么办

时间:2017-11-07 05:36:09

标签: tensorflow

我在张量流上使用MNIST数据集训练了CNN。我在测试数据集上有98%的准确率。但现在我想在现实世界的图像上测试受过训练的CNN。所以我在油漆中绘制数字并将其交给CNN。但它没有给出正确的课程。 例如:5表示8表示0表示8表示 我附上了代码。我怀疑我预测自定义输入数字的方式是错误的。

其余代码来自CNN code by HVASS

# custom input
imageName = sys.argv[1] 
image = imread(imageName,flatten=True)
example = imresize(image,(img_size,img_size))
example = example.reshape(1,img_size_flat)
print example.shape

prediction=tf.argmax(y_pred,1)
print "predictions", prediction.eval(feed_dict={x: example}, 
session=session)

image1 imag2

0 个答案:

没有答案
相关问题