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')
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')
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))