示例#1
0
def check_config(config):
    """
    Check config
    """
    check.check_version()

    mode = config.get('mode', 'train')
    check.check_gpu()

    architecture = config.get('architecture')
    check.check_architecture(architecture)

    use_mix = config.get('use_mix')
    check.check_mix(architecture, use_mix)

    classes_num = config.get('classes_num')
    check.check_classes_num(classes_num)

    if mode.lower() == 'train':
        check.check_function_params(config, 'LEARNING_RATE')
        check.check_function_params(config, 'OPTIMIZER')
示例#2
0
def check_config(config):
    """
    Check config
    """
    check.check_version()

    use_gpu = config.get('use_gpu', True)
    if use_gpu:
        check.check_gpu()

    architecture = config.get('ARCHITECTURE')
    check.check_architecture(architecture)
    check.check_model_with_running_mode(architecture)

    use_mix = config.get('use_mix', False)
    check.check_mix(architecture, use_mix)

    classes_num = config.get('classes_num')
    check.check_classes_num(classes_num)

    mode = config.get('mode', 'train')
    if mode.lower() == 'train':
        check.check_function_params(config, 'LEARNING_RATE')
        check.check_function_params(config, 'OPTIMIZER')
示例#3
0
def get(architecture, path, decompress=True):
    check_architecture(architecture)
    url = _get_url(architecture)
    fname = _download(url, path)
    if decompress: _decompress(fname)
    logger.info("download {} finished ".format(fname))