def merge_checkpoint(input_graph,<EOL>checkpoint,<EOL>output_node_names,<EOL>output_graph,<EOL>sess):
restore_op_name = "<STR_LIT>"<EOL>filename_tensor_name = "<STR_LIT>"<EOL>input_graph_def = graph_pb2.GraphDef()<EOL>with gfile.FastGFile(input_graph, "<STR_LIT:r>") as f:<EOL><INDENT>text_format.Merge(f.read().decode("<STR_LIT:utf-8>"), input_graph_def)<EOL><DEDENT>for node in input_graph_def.node:<EOL><INDENT>node.device = "<STR_LIT>"<EOL><DEDENT>importer.import_graph_def(input_graph_def, name="<STR_LIT>")<EOL>sess.run([restore_op_name], {filename_tensor_name: checkpoint})<EOL>output_graph_def = graph_util.convert_variables_to_constants(<EOL>sess,<EOL>input_graph_def,<EOL>output_node_names,<EOL>variable_names_blacklist="<STR_LIT>"<EOL>)<EOL>with gfile.GFile(output_graph, "<STR_LIT:wb>") as f:<EOL><INDENT>f.write(output_graph_def.SerializeToString())<EOL><DEDENT>
Get the variable values from the checkpoint file, and merge them to the GraphDef file
Args:
    input_graph: the GraphDef file, doesn't contain variable values
    checkpoint: the checkpoint file
    output_node_names: A list of string, the output names
    output_graph: String of the location and the name of the
        output graph