I'm trying to learn TensorFlow and I implemented the MNIST example from the the following link: http://openmachin.es/blog/tensorflow-mnist
I want to be able to actually view the training/test images.
So I'm trying to add code that will show the first train picture of the first batch:
x_i = batch_xs[0]
image = tf.reshape(x_i,[28,28])
Now, because the Data is in float32 type (with values in [0,1] range), I tried to convert it to uint16 and then to encode it to png in order to show the image.
I tried using tf.image.convert_image_dtype and tf.image.encode_png
, but with no success.
Can you guys please help me understand how can I convert the raw Data to an image and show the image?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…