title: Tensorflow: imported ops always result in "None" despite valid input & kernel
body: <p>I would like to do following:</p>
  
  <ul>
  <li>a) define model graph </li>
  <li>b) initiate the model and train it for a very
  limited NUMBER_OF_PRE_ITERATIONS (let's say,
  NUMBER_OF_PRE_ITERATIONS=20). Save the model.  </li>
  <li>c) repeat point b)
  NUMBER_OF_PRE_RUNS times (e.g. NUMBER_OF_PRE_RUNS=3). Each time, if a
  "new" model gives better results than the "saved" one, "new" model
  gets saved.</li>
  </ul>
  
  <p>As a result of c), I should have a model with (probably) best initial values out of NUMBER_OF_PRE_RUNS models.</p>
  
  <ul>
  <li>d) import the "saved" (probably) best model and proceed with training.</li>
  </ul>
  
  <p>PROBLEM: every time, all ops of the imported model result in "None" value.
  Input figures seem valid, kernel &amp; bias parameters as well. No "None" or any other suspicious figures there, just float numbers. So why "None" as result of every op?</p>
  
  <p>Here is the (simplified) code:</p>
  
  <pre><code># imports
  # declarations of variables etc.
  
  tf.reset_default_graph()
  
  with tf.variable_scope(name_or_scope='Model_', reuse=tf.AUTO_REUSE):
      x = tf.placeholder(...)
      y = tf.placeholder(...)
      input_layer = tf.layers.dense(...)
      inter_layer = tf.layers.dense(...)
      output_layer = tf.layers.dense(...)
  
      loss_funct = tf.reduce_mean(tf.abs(y - output_layer), name='loss_f')
      optimit = tf.train.GradientDescentOptimizer(learning_rate=LEARNING_RATE, name='optimit')
      train = optimit.minimize(loss=loss_funct, name='train')
  
  
  saver = tf.train.Saver()
  
  best_pre_result = 99999
  for pre_run in range(NUMBER_OF_PRE_RUNS):
      with tf.Session() as presess:
  
          presess.run(tf.global_variables_initializer())
  
          for pre_iteration in range(NUMBER_OF_PRE_ITERATIONS):
              for batch in range(NUMBER_OF_BATCHES):
                  x_batch, y_batch = get_batches(...)
                  presess.run(train, feed_dict={x: x_batch, y: y_batch})
              if pre_iteration % 10 == 0:
                  # Monitor performance here. Training seems to progress in valid way.
              if pre_iteration == NUMBER_OF_PRE_ITERATIONS - 1:
                  pre_result = presess.run(loss_funct, feed_dict={x: all_features, y: all_targets})
                  if pre_result &lt; best_pre_result:
                      best_pre_result = pre_result
                      model_path = saver.save(sess=presess, save_path=SAVE_MODEL_PATH)
  
  # tried without the below line, but result was the same.
  tf.reset_default_graph()
  
  with tf.Session() as sess:
      sess.run(tf.global_variables_initializer())        
  
      restorer = tf.train.import_meta_graph(SAVE_MODEL_PATH + ".meta")
      restorer.restore(sess=sess, save_path=model_path)
  
      x_ = tf.get_default_graph().get_tensor_by_name(name='Model_/x:0')
      y_ = tf.get_default_graph().get_tensor_by_name(name='Model_/y:0')
      compute_input_ = tf.get_default_graph().get_operation_by_name(name='Model_/input_layer/Tanh')
      # otehr operations &amp; tensors imported here for performance monitoring
      loss_funct_ = tf.get_default_graph().get_operation_by_name(name='Model_/loss_f')
      train_ = tf.get_default_graph().get_operation_by_name(name='Model_/train')
  
      for iteration in range(...):
          for batch in range(...):
              x_batch, y_batch = get_batches(...)
              sess.run(train_, feed_dict={x_: x_batch, y_: y_batch})
              # Monitor performance here. All ops result in "None".
  </code></pre>