Created
September 29, 2017 17:24
-
-
Save felipessalvatore/e7bd4f47d81e74e9b2eac82d7917fb93 to your computer and use it in GitHub Desktop.
script to grasp what the idea behind the range_input_producer
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
# range_input_producer( | |
# limit, | |
# num_epochs=None, | |
# shuffle=True, | |
# seed=None, | |
# capacity=32, | |
# shared_name=None, | |
# name=None) | |
# Produces the integers from 0 to limit-1 in a queue. | |
import tensorflow as tf | |
i = tf.train.range_input_producer(10, shuffle=False).dequeue() | |
with tf.Session() as sess: | |
coord = tf.train.Coordinator() | |
tf.train.start_queue_runners(sess, coord=coord) | |
try: | |
for step in range(11): | |
print(sess.run(i)) | |
except Exception as e: | |
print("Exception") | |
coord.request_stop() | |
finally: | |
coord.request_stop() | |
coord.join() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment