python 2.7 - How to mix queue-based and feed-based input in TensorFlow -
i've migrated fully_connected style model reads inputs queue generated tfrecords file. has proven more efficient, still pass parameters interactively placeholder/feed_dict.
is there way use same computation graph (say have model class builds graph in init method) both feed_dict , full_connected functionality? can placeholder receive values dequeue?
you feed output of dequeue operation. tensorflow not dequeue item, use value provided. example:
q = tf.fifoqueue(capacity=10, dtypes=[tf.float32], shapes=[()]) v = tf.placeholder(tf.float32) enqueue = q.enqueue([v]) dequeue = q.dequeue() output = dequeue + 10.0 tf.session() sess: sess.run(enqueue, feed_dict={v: 1.0}) sess.run(enqueue, feed_dict={v: 2.0}) sess.run(enqueue, feed_dict={v: 3.0}) print(sess.run(output)) # 11.0 print(sess.run(output, feed_dict={dequeue: 5.0})) # 15.0 print(sess.run(output)) # 12.0 print(sess.run(output)) # 13.0