See how fasterrcnn_resnet50_fpn use FasterRCNN 93
def fasterrcnn_resnet50_fpn(pretrained=False, progress=True,
                            num_classes=91, pretrained_backbone=True, **kwargs):
    if pretrained:
        pretrained_backbone = False
    backbone = resnet_fpn_backbone('resnet50', pretrained_backbone)
    model = FasterRCNN(backbone, num_classes, **kwargs)
    if pretrained:
        state_dict = load_state_dict_from_url(model_urls['fasterrcnn_resnet50_fpn_coco'],
                                              progress=progress)
        model.load_state_dict(state_dict)
    return model

# FasterRCNN __init__ function
if num_classes is not None:
    if box_predictor is not None:
        raise ValueError("num_classes should be None when box_predictor is specified")
    else:
        if box_predictor is None:
            raise ValueError("num_classes should not be None when box_predictor "
                                 "is not specified")

Specify num_classes or box_predictor.