diff --git a/docs/source/models/resnet.rst b/docs/source/models/resnet.rst index 7976eb437e5..9d777f2f6b1 100644 --- a/docs/source/models/resnet.rst +++ b/docs/source/models/resnet.rst @@ -6,6 +6,11 @@ ResNet The ResNet model is based on the `Deep Residual Learning for Image Recognition `_ paper. +.. note:: + The bottleneck of TorchVision places the stride for downsampling to the second 3x3 + convolution while the original paper places it to the first 1x1 convolution. + This variant improves the accuracy and is known as `ResNet V1.5 + `_. Model builders -------------- diff --git a/torchvision/models/resnet.py b/torchvision/models/resnet.py index 39662b1cc0a..93f0d06f67b 100644 --- a/torchvision/models/resnet.py +++ b/torchvision/models/resnet.py @@ -699,6 +699,12 @@ def resnet34(*, weights: Optional[ResNet34_Weights] = None, progress: bool = Tru def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet: """ResNet-50 from `Deep Residual Learning for Image Recognition `__. + .. note:: + The bottleneck of TorchVision places the stride for downsampling to the second 3x3 + convolution while the original paper places it to the first 1x1 convolution. + This variant improves the accuracy and is known as `ResNet V1.5 + `_. + Args: weights (:class:`~torchvision.models.ResNet50_Weights`, optional): The pretrained weights to use. See @@ -724,6 +730,12 @@ def resnet50(*, weights: Optional[ResNet50_Weights] = None, progress: bool = Tru def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet: """ResNet-101 from `Deep Residual Learning for Image Recognition `__. + .. note:: + The bottleneck of TorchVision places the stride for downsampling to the second 3x3 + convolution while the original paper places it to the first 1x1 convolution. + This variant improves the accuracy and is known as `ResNet V1.5 + `_. + Args: weights (:class:`~torchvision.models.ResNet101_Weights`, optional): The pretrained weights to use. See @@ -749,6 +761,12 @@ def resnet101(*, weights: Optional[ResNet101_Weights] = None, progress: bool = T def resnet152(*, weights: Optional[ResNet152_Weights] = None, progress: bool = True, **kwargs: Any) -> ResNet: """ResNet-152 from `Deep Residual Learning for Image Recognition `__. + .. note:: + The bottleneck of TorchVision places the stride for downsampling to the second 3x3 + convolution while the original paper places it to the first 1x1 convolution. + This variant improves the accuracy and is known as `ResNet V1.5 + `_. + Args: weights (:class:`~torchvision.models.ResNet152_Weights`, optional): The pretrained weights to use. See