Created
July 6, 2018 15:04
-
-
Save RomanSteinberg/0ed06bbd146d6f9297221f16bc4766c7 to your computer and use it in GitHub Desktop.
start_queue_runners
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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