'Builds the inference graph from a configuration object.
Args:
model_config: Object containing configuration for building the model.
checkpoint_path: Checkpoint file or a directory containing a checkpoint
file.
Returns:
restore_fn: A function such that restore_fn(sess) loads model variables
from the checkpoint file.'

def build_graph_from_config(self, model_config, checkpoint_path):

    tf.logging.info('Building    model.')
    self.build_model(model_config)
    saver = tf.train.Saver()
    return self._create_restore_fn(checkpoint_path, saver)
