title: Cannot find the variable that is input to the ReadVariableOp
body: <p>Trying to save a Keras .h5 file containing weights to Tensorflow .pb file</p>
  
  <pre><code># I keep getting the error:  ValueError: Cannot find the variable that is an input to the ReadVariableOp.
  frozen_graph = freeze_session(K.get_session(),
                                output_names=[out.op.name for out in model.keras_model.output])
  </code></pre>
  
  <p>0</p>
  
  <p>frozen_graph = freeze_session(K.get_session(), output_names=[out.op.name for out in model.keras_model.output])</p>
  
  <p>I got an error:</p>
  
  <blockquote>
    <p>ValueError Traceback (most recent call last) in 1 frozen_graph =
    freeze_session(K.get_session(), ----> 2 output_names=[out.op.name for
    out in model.keras_model.output])</p>
    
    <p>in freeze_session(session, keep_var_names, output_names,
    clear_devices) 26 node.device = "" 27 frozen_graph =
    tf.graph_util.convert_variables_to_constants( ---> 28 session,
    input_graph_def, output_names, freeze_var_names) 29 return
    frozen_graph</p>
    
    <p>~/anaconda3/envs/env_name/lib/python3.6/site-packages/tensorflow/python/util/deprecation.py
    in new_func(*args, **kwargs) 322 'in a future version' if date is None
    else ('after %s' % date), 323 instructions) --> 324 return func(*args,
    **kwargs) 325 return tf_decorator.make_decorator( 326 func, new_func, 'deprecated',</p>
    
    <p>~/anaconda3/envs/env_name/lib/python3.6/site-packages/tensorflow/python/framework/graph_util_impl.py
    in convert_variables_to_constants(sess, input_graph_def,
    output_node_names, variable_names_whitelist, variable_names_blacklist)
    300 source_op_name = get_input_name(map_name_to_node[source_op_name])
    301 if map_name_to_node[source_op_name].op != "VarHandleOp": --> 302
    raise ValueError("Cannot find the variable that is an input " 303 "to
    the ReadVariableOp.") 304</p>
    
    <p>ValueError: Cannot find the variable that is an input to the
    ReadVariableOp.</p>
  </blockquote>