title: TensorFlow: Restoring Multiple Graphs
body: <p>Suppose we have two TensorFlow computation graphs, <code>G1</code> and <code>G2</code>, with saved weights <code>W1</code> and <code>W2</code>. Assume we build a new graph <code>G</code> simply by  constructing <code>G1</code> and <code>G2</code>. How can we restore both <code>W1</code> and <code>W2</code> for this new graph <code>G</code>?</p>
  
  <p>For a simple example:</p>
  
  <pre class="lang-py prettyprint-override"><code>import tensorflow as tf
  
  V1 = tf.Variable(tf.zeros([1]))
  saver_1 = tf.train.Saver()
  V2 = tf.Variable(tf.zeros([1]))
  saver_2 = tf.train.Saver()
  
  sess = tf.Session()
  saver_1.restore(sess, 'W1')
  saver_2.restore(sess, 'W2')
  </code></pre>
  
  <p>In this example, <code>saver_1</code> succesfully restores the corresponding <code>V1</code>, but <code>saver_2</code> fails with a <code>NotFoundError</code>.</p>