'Builds the TF graph given a checkpoint file.
Calls into _build_graph_for_generation, which must be implemented by the
subclass, before restoring the checkpoint.
Args:
checkpoint_file: The path to the checkpoint file that should be used.'

def initialize_with_checkpoint(self, checkpoint_file):

    graph = self._build_graph_for_generation()
    with graph.as_default():
        saver = tf.train.Saver()
        self._session = tf.Session()
        tf.logging.info('Checkpoint    used:    %s', checkpoint_file)
        saver.restore(self._session, checkpoint_file)
