def freeze(sess, output_file_path, output_node_names):
with TemporaryDirectory() as temp_dir_name:<EOL><INDENT>checkpoint_path = os.path.join(temp_dir_name, '<STR_LIT>')<EOL>tf.train.Saver().save(sess, checkpoint_path)<EOL>freeze_from_checkpoint(checkpoint_path, output_file_path, output_node_names)<EOL><DEDENT>
Freeze and shrink the graph based on a session and the output node names.