def get_imagenet_models(config):
    super_type = getattr(config, 'super_type', 'basic')
    if (super_type == 'basic'):
        from .ImageNet_ResNet import ResNet
        from .ImageNet_MobileNetV2 import MobileNetV2
        if (config.arch == 'resnet'):
            return ResNet(config.block_name, config.layers, config.deep_stem, config.class_num, config.zero_init_residual, config.groups, config.width_per_group)
        elif (config.arch == 'mobilenet_v2'):
            return MobileNetV2(config.class_num, config.width_multi, config.input_channel, config.last_channel, 'InvertedResidual', config.dropout)
        else:
            raise ValueError('invalid arch : {:}'.format(config.arch))
    elif super_type.startswith('infer'):
        assert (len(super_type.split('-')) == 2), 'invalid super_type : {:}'.format(super_type)
        infer_mode = super_type.split('-')[1]
        if (infer_mode == 'shape'):
            from .shape_infers import InferImagenetResNet
            from .shape_infers import InferMobileNetV2
            if (config.arch == 'resnet'):
                return InferImagenetResNet(config.block_name, config.layers, config.xblocks, config.xchannels, config.deep_stem, config.class_num, config.zero_init_residual)
            elif (config.arch == 'MobileNetV2'):
                return InferMobileNetV2(config.class_num, config.xchannels, config.xblocks, config.dropout)
            else:
                raise ValueError('invalid arch-mode : {:}'.format(config.arch))
        else:
            raise ValueError('invalid infer-mode : {:}'.format(infer_mode))
    else:
        raise ValueError('invalid super-type : {:}'.format(super_type))
def get_imagenet_models(config):
    super_type = getattr(config, 'super_type', 'basic')
    if (super_type == 'basic'):
        from .ImageNet_ResNet import ResNet
        from .ImageNet_MobileNetV2 import MobileNetV2
        if (config.arch == 'resnet'):
            return ResNet(config.block_name, config.layers, config.deep_stem, config.class_num, config.zero_init_residual, config.groups, config.width_per_group)
        elif (config.arch == 'mobilenet_v2'):
            return MobileNetV2(config.class_num, config.width_multi, config.input_channel, config.last_channel, 'InvertedResidual', config.dropout)
        else:
            raise ValueError('invalid arch : {:}'.format(config.arch))
    elif super_type.startswith('infer'):
        assert (len(super_type.split('-')) == 2), 'invalid super_type : {:}'.format(super_type)
        infer_mode = super_type.split('-')[1]
        if (infer_mode == 'shape'):
            from .shape_infers import InferImagenetResNet
            from .shape_infers import InferMobileNetV2
            if (config.arch == 'resnet'):
                return InferImagenetResNet(config.block_name, config.layers, config.xblocks, config.xchannels, config.deep_stem, config.class_num, config.zero_init_residual)
            elif (config.arch == 'MobileNetV2'):
                return InferMobileNetV2(config.class_num, config.xchannels, config.xblocks, config.dropout)
            else:
                raise ValueError('invalid arch-mode : {:}'.format(config.arch))
        else:
            raise ValueError('invalid infer-mode : {:}'.format(infer_mode))
    else:
        raise ValueError('invalid super-type : {:}'.format(super_type))