threads = tf.train.start_queue_runners(sess=sess, coord=coord)
for i in range(3): // number of mini-batch (step)
print("Step %d" % i)
val, l = sess.run([img_batch, label_batch])
print(val.shape, l)
tl.visualize.images2d(val, second=1, saveable=False, name="batch" + str(i), dtype=np.uint8, fig_idx=2020121)
tl.vis.save_images(val, [2, 2], "_batch_%d.png" % i)
After Change
for img_batch, label_batch in read_and_decode("train.cifar10"):
tl.visualize.images2d(img_batch, second=1, saveable=False, name="batch" + str(i), dtype=np.uint8, fig_idx=2020121)
i += 1
if i >= 3:
break