def _fasterrcnn_mobilenet_v3_large_fpn(weights_name, pretrained=False, progress=True, num_classes=91, pretrained_backbone=True, trainable_backbone_layers=None, **kwargs):
    is_trained = (pretrained or pretrained_backbone)
    trainable_backbone_layers = _validate_trainable_layers(is_trained, trainable_backbone_layers, 6, 3)
    norm_layer = (misc_nn_ops.FrozenBatchNorm2d if is_trained else nn.BatchNorm2d)
    if pretrained:
        pretrained_backbone = False
    backbone = mobilenet_v3_large(pretrained=pretrained_backbone, progress=progress, norm_layer=norm_layer)
    backbone = _mobilenet_extractor(backbone, True, trainable_backbone_layers)
    anchor_sizes = (((32, 64, 128, 256, 512),) * 3)
    aspect_ratios = (((0.5, 1.0, 2.0),) * len(anchor_sizes))
    model = FasterRCNN(backbone, num_classes, rpn_anchor_generator=AnchorGenerator(anchor_sizes, aspect_ratios), **kwargs)
    if pretrained:
        if (model_urls.get(weights_name, None) is None):
            raise ValueError(f'No checkpoint is available for model {weights_name}')
        state_dict = load_state_dict_from_url(model_urls[weights_name], progress=progress)
        model.load_state_dict(state_dict)
    return model
def _fasterrcnn_mobilenet_v3_large_fpn(weights_name, pretrained=False, progress=True, num_classes=91, pretrained_backbone=True, trainable_backbone_layers=None, **kwargs):
    is_trained = (pretrained or pretrained_backbone)
    trainable_backbone_layers = _validate_trainable_layers(is_trained, trainable_backbone_layers, 6, 3)
    norm_layer = (misc_nn_ops.FrozenBatchNorm2d if is_trained else nn.BatchNorm2d)
    if pretrained:
        pretrained_backbone = False
    backbone = mobilenet_v3_large(pretrained=pretrained_backbone, progress=progress, norm_layer=norm_layer)
    backbone = _mobilenet_extractor(backbone, True, trainable_backbone_layers)
    anchor_sizes = (((32, 64, 128, 256, 512),) * 3)
    aspect_ratios = (((0.5, 1.0, 2.0),) * len(anchor_sizes))
    model = FasterRCNN(backbone, num_classes, rpn_anchor_generator=AnchorGenerator(anchor_sizes, aspect_ratios), **kwargs)
    if pretrained:
        if (model_urls.get(weights_name, None) is None):
            raise ValueError(f'No checkpoint is available for model {weights_name}')
        state_dict = load_state_dict_from_url(model_urls[weights_name], progress=progress)
        model.load_state_dict(state_dict)
    return model