(logdir)
return config
Load a configuration from the log directory.

    Args:
      logdir: The logging directory containing the configuration file.

    Raises:
      IOError: The logging directory does not contain a configuration file.

    Returns:
      Configuration object.
Load a configuration from the log directory.
Load a configuration from the log directory .
def load_config(logdir):
    """Load a configuration from the log directory.

    Args:
      logdir: The logging directory containing the configuration file.

    Raises:
      IOError: The logging directory does not contain a configuration file.

    Returns:
      Configuration object.
    """
    config_path = logdir and os.path.join(logdir, 'config.yaml')
    if not config_path or not os.path.exists(config_path):
        message = (
            'Cannot resume an existing run since the logging directory does not '
            'contain a configuration file.')
        raise IOError(message)
    with open(config_path, 'r') as file_:
        config = yaml.load(file_)
    message = 'Resume run and write summaries and checkpoints to {}.'
    logging.info(message.format(config.logdir))
    return config
def load_config ( logdir ) : config_path = logdir and os . path . join ( logdir , 'config.yaml' ) if not config_path or not os . path . exists ( config_path ) : message = ( 'Cannot resume an existing run since the logging directory does not ' 'contain a configuration file.' ) raise IOError ( message ) with open ( config_path , 'r' ) as file_ : config = yaml . load ( file_ ) message = 'Resume run and write summaries and checkpoints to {}.' logging . info ( message . format ( config . logdir ) ) return config