TensorFlow queue feed order
<p>I'm wondering in what order TensorFlow queues feed data (specifically when you have a list of tensors that they're feeding from).</p>

<p>For example, in  a queue like this:</p>

<pre><code>fifo_q = tf.FIFOQueue(
              capacity=10,
              dtypes=[tf.string, tf.string]
              shapes=[[], []])
</code></pre>

<p>If I enqueue these lists:</p>

<pre><code>sess = tf.Session()

l = [str(i+1) for i in range(10)]
x = tf.constant(l)
y = tf.constant(l)

eq = fifo_q.enqueue_many([x, y])
dq1, dq2 = fifo_q.dequeue()
sess.run(eq)
</code></pre>

<p>I would expect <code>dq1</code>, <code>dq2</code> to be '1', '1' the on the first run, then '2', '2' and so on. But this isn't what's happening. Instead, when I run the following code, I get '1', '2' and then '3', '4', and so on until <code>dq2</code> reaches 10, and then the queue locks up.</p>

<pre><code>for x in range(6):
  print('dq1:', sess.run(dq1))
  print('dq2:', sess.run(dq2))
</code></pre>

<p>Why does this happen instead of what I expect? I'm using this to match up training examples with labels, but some training examples and labels are skipped/off-set. Is a better solution just to interleave the file names in a single queue? Either way, I would like to understand this behavior.</p>

<p>Any help is appreciated.</p>