From c9c72468d6eea3bc99b6593e306c3d4abacd839b Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 30 Jun 2021 09:15:54 +0100 Subject: [PATCH 1/4] fix googlenet docstring --- torchvision/models/googlenet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index 0745ef4eef6..9e63803a8ed 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -34,7 +34,7 @@ def googlenet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> aux_logits (bool): If True, adds two auxiliary branches that can improve training. Default: *False* when pretrained is True otherwise *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: *True* """ if pretrained: if 'transform_input' not in kwargs: From 0534a7c3c5ff6ff119d4d5215f512f19a2c102e8 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 30 Jun 2021 09:22:06 +0100 Subject: [PATCH 2/4] fix the rest --- torchvision/models/inception.py | 2 +- torchvision/models/quantization/googlenet.py | 2 +- torchvision/models/quantization/inception.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index b9c6ab74534..e53ff616e20 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -38,7 +38,7 @@ def inception_v3(pretrained: bool = False, progress: bool = True, **kwargs: Any) aux_logits (bool): If True, add an auxiliary branch that can improve training. Default: *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: *True* """ if pretrained: if 'transform_input' not in kwargs: diff --git a/torchvision/models/quantization/googlenet.py b/torchvision/models/quantization/googlenet.py index bc1477d8f65..07c6f79eb62 100644 --- a/torchvision/models/quantization/googlenet.py +++ b/torchvision/models/quantization/googlenet.py @@ -33,7 +33,7 @@ def googlenet(pretrained=False, progress=True, quantize=False, **kwargs): aux_logits (bool): If True, adds two auxiliary branches that can improve training. Default: *False* when pretrained is True otherwise *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: *True* """ if pretrained: if 'transform_input' not in kwargs: diff --git a/torchvision/models/quantization/inception.py b/torchvision/models/quantization/inception.py index 833d8fb8b75..074036c34fa 100644 --- a/torchvision/models/quantization/inception.py +++ b/torchvision/models/quantization/inception.py @@ -41,7 +41,7 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs): aux_logits (bool): If True, add an auxiliary branch that can improve training. Default: *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: *True* """ if pretrained: if "transform_input" not in kwargs: From 93421acce0bbfaea7bfac3a3b5b3a90aad1efd19 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 30 Jun 2021 12:48:26 +0100 Subject: [PATCH 3/4] default is actually conditional on pretrained param --- torchvision/models/googlenet.py | 2 +- torchvision/models/inception.py | 2 +- torchvision/models/quantization/googlenet.py | 2 +- torchvision/models/quantization/inception.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index 9e63803a8ed..816f1ada086 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -34,7 +34,7 @@ def googlenet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> aux_logits (bool): If True, adds two auxiliary branches that can improve training. Default: *False* when pretrained is True otherwise *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *True* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if 'transform_input' not in kwargs: diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index e53ff616e20..879ef3e0377 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -38,7 +38,7 @@ def inception_v3(pretrained: bool = False, progress: bool = True, **kwargs: Any) aux_logits (bool): If True, add an auxiliary branch that can improve training. Default: *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *True* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if 'transform_input' not in kwargs: diff --git a/torchvision/models/quantization/googlenet.py b/torchvision/models/quantization/googlenet.py index 07c6f79eb62..5af47a90cab 100644 --- a/torchvision/models/quantization/googlenet.py +++ b/torchvision/models/quantization/googlenet.py @@ -33,7 +33,7 @@ def googlenet(pretrained=False, progress=True, quantize=False, **kwargs): aux_logits (bool): If True, adds two auxiliary branches that can improve training. Default: *False* when pretrained is True otherwise *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *True* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if 'transform_input' not in kwargs: diff --git a/torchvision/models/quantization/inception.py b/torchvision/models/quantization/inception.py index 074036c34fa..71f40dee34c 100644 --- a/torchvision/models/quantization/inception.py +++ b/torchvision/models/quantization/inception.py @@ -41,7 +41,7 @@ def inception_v3(pretrained=False, progress=True, quantize=False, **kwargs): aux_logits (bool): If True, add an auxiliary branch that can improve training. Default: *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *True* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if "transform_input" not in kwargs: From 2738aaba17fca920bd60dacc5b96aedc59a0e661 Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 13 Dec 2021 14:40:36 +0000 Subject: [PATCH 4/4] clarify docstrings --- torchvision/models/googlenet.py | 2 +- torchvision/models/inception.py | 2 +- torchvision/models/quantization/googlenet.py | 2 +- torchvision/models/quantization/inception.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/torchvision/models/googlenet.py b/torchvision/models/googlenet.py index 7ead46a4ef6..476da0d8a53 100644 --- a/torchvision/models/googlenet.py +++ b/torchvision/models/googlenet.py @@ -287,7 +287,7 @@ def googlenet(pretrained: bool = False, progress: bool = True, **kwargs: Any) -> aux_logits (bool): If True, adds two auxiliary branches that can improve training. Default: *False* when pretrained is True otherwise *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if "transform_input" not in kwargs: diff --git a/torchvision/models/inception.py b/torchvision/models/inception.py index 714e5e9e406..85236c6dfb3 100644 --- a/torchvision/models/inception.py +++ b/torchvision/models/inception.py @@ -422,7 +422,7 @@ def inception_v3(pretrained: bool = False, progress: bool = True, **kwargs: Any) aux_logits (bool): If True, add an auxiliary branch that can improve training. Default: *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if "transform_input" not in kwargs: diff --git a/torchvision/models/quantization/googlenet.py b/torchvision/models/quantization/googlenet.py index d81f227b6f1..ff2352daa35 100644 --- a/torchvision/models/quantization/googlenet.py +++ b/torchvision/models/quantization/googlenet.py @@ -123,7 +123,7 @@ def googlenet( aux_logits (bool): If True, adds two auxiliary branches that can improve training. Default: *False* when pretrained is True otherwise *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if "transform_input" not in kwargs: diff --git a/torchvision/models/quantization/inception.py b/torchvision/models/quantization/inception.py index 83665be370f..379f4da548e 100644 --- a/torchvision/models/quantization/inception.py +++ b/torchvision/models/quantization/inception.py @@ -197,7 +197,7 @@ def inception_v3( aux_logits (bool): If True, add an auxiliary branch that can improve training. Default: *True* transform_input (bool): If True, preprocesses the input according to the method with which it - was trained on ImageNet. Default: *False* + was trained on ImageNet. Default: True if ``pretrained=True``, else False. """ if pretrained: if "transform_input" not in kwargs: