title: How to test a network during training in tensorflow when using a queue
body: <p>I am using a queue to feed my training examples to my network using the code below, and it works properly.</p>
  
  <p>However, I would like to be able to feed some <em>testing data</em> every <em>n</em> iterations, but I don't really know how I should proceed. Should I stop momentarily the queue and feed the testing data manually? Should I create another queue just for testing data?</p>
  
  <p><strong>Edit:</strong> Is the right way of doing it is to create a separate file, say <code>eval.py</code>, that continuously reads the last checkpoint and evaluates the network? This is how they do it in the CIFAR10 example.</p>
  
  <pre><code>batch = 128 # size of the batch
  x = tf.placeholder("float32", [None, n_steps, n_input])
  y = tf.placeholder("float32", [None, n_classes])
  
  queue = tf.RandomShuffleQueue(capacity=4*batch,
                        min_after_dequeue=3*batch,
                        dtypes=[tf.float32, tf.float32],
                        shapes=[[n_steps, n_input], [n_classes]])
  enqueue_op = queue.enqueue_many([x, y])
  X_batch, Y_batch = queue.dequeue_many(batch)
  
  sess = tf.Session()
  
  def load_and_enqueue(data):
      while True:
          X, Y = data.get_next_batch(batch)
          sess.run(enqueue_op, feed_dict={x: X, y: Y})
  
  train_thread = threading.Thread(target=load_and_enqueue, args=(data))
  train_thread.daemon = True
  train_thread.start()
  
  for _ in xrange(max_iter):
      sess.run(train_op)
  </code></pre>