Skip to content

Instantly share code, notes, and snippets.

@russellizadi
Created April 23, 2018 00:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save russellizadi/979e09024e8e1bce9fea2b5b8aaee53e to your computer and use it in GitHub Desktop.
Save russellizadi/979e09024e8e1bce9fea2b5b8aaee53e to your computer and use it in GitHub Desktop.
mnist
import tensorflow as tf
import matplotlib.pyplot as plt
from datasets import mnist
dataset = mnist.train()
iterator = dataset.make_one_shot_iterator()
next_image, next_label = iterator.get_next()
with tf.Session() as sess:
next_image, next_label = sess.run([next_image, next_label])
next_image = np.reshape(next_image, [28, 28])
print(next_label)
plt.imshow(next_image)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment