diff --git a/torchvision/models/detection/faster_rcnn.py b/torchvision/models/detection/faster_rcnn.py index cc044b68245..1b4213ba04e 100644 --- a/torchvision/models/detection/faster_rcnn.py +++ b/torchvision/models/detection/faster_rcnn.py @@ -379,7 +379,8 @@ def fasterrcnn_resnet50_fpn( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. + Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 3. """ trainable_backbone_layers = _validate_trainable_layers( pretrained or pretrained_backbone, trainable_backbone_layers, 5, 3 @@ -464,7 +465,8 @@ def fasterrcnn_mobilenet_v3_large_320_fpn( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. + Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 3. """ weights_name = "fasterrcnn_mobilenet_v3_large_320_fpn_coco" defaults = { @@ -509,7 +511,8 @@ def fasterrcnn_mobilenet_v3_large_fpn( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. + Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 3. """ weights_name = "fasterrcnn_mobilenet_v3_large_fpn_coco" defaults = { diff --git a/torchvision/models/detection/keypoint_rcnn.py b/torchvision/models/detection/keypoint_rcnn.py index 81e64cd7231..71893b3b0d0 100644 --- a/torchvision/models/detection/keypoint_rcnn.py +++ b/torchvision/models/detection/keypoint_rcnn.py @@ -360,7 +360,8 @@ def keypointrcnn_resnet50_fpn( num_keypoints (int): number of keypoints, default 17 pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. + Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 3. """ trainable_backbone_layers = _validate_trainable_layers( pretrained or pretrained_backbone, trainable_backbone_layers, 5, 3 diff --git a/torchvision/models/detection/mask_rcnn.py b/torchvision/models/detection/mask_rcnn.py index a76cd34b055..f4278cfb502 100644 --- a/torchvision/models/detection/mask_rcnn.py +++ b/torchvision/models/detection/mask_rcnn.py @@ -357,7 +357,8 @@ def maskrcnn_resnet50_fpn( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. + Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 3. """ trainable_backbone_layers = _validate_trainable_layers( pretrained or pretrained_backbone, trainable_backbone_layers, 5, 3 diff --git a/torchvision/models/detection/retinanet.py b/torchvision/models/detection/retinanet.py index 4b1e2a2c774..e5ced9870ba 100644 --- a/torchvision/models/detection/retinanet.py +++ b/torchvision/models/detection/retinanet.py @@ -623,7 +623,8 @@ def retinanet_resnet50_fpn( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. + Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 3. """ trainable_backbone_layers = _validate_trainable_layers( pretrained or pretrained_backbone, trainable_backbone_layers, 5, 3 diff --git a/torchvision/models/detection/ssd.py b/torchvision/models/detection/ssd.py index be30bb54c40..5778a07075d 100644 --- a/torchvision/models/detection/ssd.py +++ b/torchvision/models/detection/ssd.py @@ -587,7 +587,8 @@ def ssd300_vgg16( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. + Valid values are between 0 and 5, with 5 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 4. """ if "size" in kwargs: warnings.warn("The size of the model is already fixed; ignoring the argument.") diff --git a/torchvision/models/detection/ssdlite.py b/torchvision/models/detection/ssdlite.py index 652d3afe4d4..d35dfbf78d3 100644 --- a/torchvision/models/detection/ssdlite.py +++ b/torchvision/models/detection/ssdlite.py @@ -208,7 +208,8 @@ def ssdlite320_mobilenet_v3_large( num_classes (int): number of output classes of the model (including the background) pretrained_backbone (bool): If True, returns a model with backbone pre-trained on Imagenet trainable_backbone_layers (int): number of trainable (not frozen) resnet layers starting from final block. - Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. + Valid values are between 0 and 6, with 6 meaning all backbone layers are trainable. If ``None`` is + passed (the default) this value is set to 6. norm_layer (callable, optional): Module specifying the normalization layer to use. """ if "size" in kwargs: