Ejemplo n.º 1
0
def get_config(config_mode):
    """Get model config."""
    config = None
    if config_mode == "small":
        config = model_config.SmallConfig()
    elif config_mode == "medium":
        config = model_config.MediumConfig()
    elif config_model == "large":
        config = model_config.LargeConfig()
    elif config_mode == "test":
        config = model_config.TestConfig()
    else:
        raise ValueError("Invalid model: %s", config_mode)
    return config
Ejemplo n.º 2
0
def get_config():
    """Get model config."""
    config = None
    if FLAGS.model == "small":
        config = model_config.SmallConfig()
    elif FLAGS.model == "medium":
        config = model_config.MediumConfig()
    elif FLAGS.model == "large":
        config = model_config.LargeConfig()
    elif FLAGS.model == "test":
        config = model_config.TestConfig()
    else:
        raise ValueError("Invalid model: %s", FLAGS.model)
    if FLAGS.rnn_mode:
        config.rnn_mode = FLAGS.rnn_mode
    if FLAGS.num_gpus != 1 or tf.__version__ < "1.3.0":
        config.rnn_mode = "basic"
    return config