title: Feeding tensors for training vs validation data
body: <p>In the tensorflow examples, feed_dict is used to send either training or validation input into the same model graph. Unfortunately, you cannot feed tensors:</p>
  
  <pre><code>    Acceptable feed values include Python scalars, strings, lists, or numpy ndarrays.
  </code></pre>
  
  <p>I've been using an input pipeline and <code>TFRecordReader</code>, so my data never really enters python. Having to call <code>run</code> to get the data into python just to feed it back to tensorflow seems silly and is definitely slow.</p>
  
  <p>Does anyone have a good solution for this?</p>
  
  <p>Currently, I just create two identical copies of the model subgraph that use the same parameters. This works, but forces me to organize my code in an odd way.</p>
  
  <p>EDIT</p>
  
  <p>For example, I'm currently doing something like:</p>
  
  <pre><code>model_params = BuildModelParams()
  train_model = BuildModel(model_params, train_input)
  test_model = BuildModel(model_params, test_input)
  </code></pre>
  
  <p>so that the test model uses the parameters learned by training. The nice thing about <code>feed_dict</code> is that I only need to define the model once and I do not have to separate the model's parameters from its structure.</p>