Skip to content

Instantly share code, notes, and snippets.

@RomanSteinberg
Created July 6, 2018 15:04
Show Gist options
  • Save RomanSteinberg/0ed06bbd146d6f9297221f16bc4766c7 to your computer and use it in GitHub Desktop.
Save RomanSteinberg/0ed06bbd146d6f9297221f16bc4766c7 to your computer and use it in GitHub Desktop.
start_queue_runners
import tensorflow as tf
from glob import glob
folder = './data/*.jpg'
def create_graph():
filename_queue = tf.train.string_input_producer(list(glob(folder)))
reader = tf.TextLineReader()
key, value = reader.read(filename_queue)
image_decoded_A = tf.image.decode_jpeg(value, channels=3)
return image_decoded_A, key
def main():
with tf.Session() as sess:
coord = tf.train.Coordinator()
threads = tf.train.start_queue_runners(coord=coord)
img, fname = create_graph()
data = sess.run(img)
coord.request_stop()
coord.join(threads)
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment