def METHOD_NAME(self, num_classes: int,
                        in_channels: int) -> nn.Module:
    from torchvision import models
    backbone_name = self.get_backbone_str()
    pretrained = self.pretrained
    weights = 'DEFAULT' if pretrained else None
    model_factory_func: Callable[..., nn.Module] = getattr(
        models, backbone_name)
    model = model_factory_func(weights=weights, **self.extra_args)
    if in_channels != 3:
        if not backbone_name.startswith('resnet'):
            raise ConfigError(
                'All TorchVision backbones do not provide the same API '
                'for accessing the first conv layer. '
                'Therefore, conv layer modification to support '
                'arbitrary input channels is only supported for resnet '
                'backbones. To use other backbones, it is recommended to '
                'fork the TorchVision repo, define factory functions or '
                'subclasses that perform the necessary modifications, and '
                'then use the external model functionality to import it '
                'into Raster Vision. See spacenet_rio.py for an example '
                'of how to import external models. Alternatively, you can '
                'override this function.')
        model.conv1 = adjust_conv_channels(
            old_conv=model.conv1,
            in_channels=in_channels,
            pretrained=pretrained)
    in_features = model.fc.in_features
    model.fc = nn.Linear(in_features, num_classes)
    return model