title: Tensorflow: Storing in models
body: <p>I am new to tf and i want to store the activation in the model. </p>
  
  <p>I am trying to build an image classifier and while predicting one image using <code>sess.run(activation,feed_dict={X:npArray})</code>. </p>
  
  <p>How do I store the activation and X in the model and restore them back?</p>
  
  <p>I am using something like this for restoring </p>
  
  <pre><code>y_pred = tf.get_default_graph().get_tensor_by_name('y_pred:0')
  X = tf.get_default_graph().get_tensor_by_name('X:0')
  </code></pre>
  
  <p>and then using </p>
  
  <pre><code>output_label = sess.run(y_pred, feed_dict={X: npArray}) 
  </code></pre>
  
  <p>for predicting the label of the class but no matter what the npArray input is, the output_label doesn't change. If even the stored model changes, the output_label does not change. This can mean that the variable y_pred and placeholder X are not </p>
  
  <blockquote>
    <ol>
    <li>either stored properly in the model; or</li>
    <li>they are not restored properly</li>
    </ol>
  </blockquote>
  
  <p>Any help will be appreciated. Thanks</p>