(ckpt_path, sess_config, print_op=False)
return graph, sess
load graph and session from checkpoint file
load graph and session from checkpoint file
load graph and session from checkpoint file
def load_graph_session_from_ckpt(ckpt_path, sess_config, print_op=False):
  """load graph and session from checkpoint file"""
  graph = tf.Graph()
  with graph.as_default():  #pylint: disable=not-context-manager
    sess = get_session(sess_config)
    with sess.as_default():  #pylint: disable=not-context-manager
      # Load the saved meta graph and restore variables
      saver = tf.train.import_meta_graph("{}.meta".format(ckpt_path))
      saver.restore(sess, ckpt_path)
    if print_op:
      print_ops(graph, prefix='load_graph_session_from_ckpt')
  return graph, sess
def load_graph_session_from_ckpt ( ckpt_path , sess_config , print_op = False ) : graph = tf . Graph ( ) with graph . as_default ( ) : #pylint: disable=not-context-manager sess = get_session ( sess_config ) with sess . as_default ( ) : #pylint: disable=not-context-manager # Load the saved meta graph and restore variables saver = tf . train . import_meta_graph ( "{}.meta" . format ( ckpt_path ) ) saver . restore ( sess , ckpt_path ) if print_op : print_ops ( graph , prefix = 'load_graph_session_from_ckpt' ) return graph , sess