tensorflow, , , - /. Tensorflow QueueRunner, . Coordinator .
https://www.tensorflow.org/programmers_guide/threading_and_queues
:
qr = tf.train.QueueRunner(queue, [enqueue_op] * 4)
sess = tf.Session()
coord = tf.train.Coordinator()
enqueue_threads = qr.create_threads(sess, coord=coord, start=True)
for step in xrange(1000000):
if coord.should_stop():
break
sess.run(train_op)
coord.request_stop()
coord.join(enqueue_threads)
/ ( , TF), QueueRunner, sess.run(enqueue_op, feed_dict={...})
.
Q1: : qr.create_threads(sess, coord=coord, start=True)
Q2: TF , tf.run(...)
. QueueRunner . .
Q3: tf.train.string_input_producer
, , , , dequeued
, sess.run([train_op, dequeue_op])