From a967740fdb3637a438eb42ab544a746a7d3c763f Mon Sep 17 00:00:00 2001 From: Joao Gomes Date: Tue, 3 May 2022 16:45:13 +0100 Subject: [PATCH 1/4] Remove references to non-existing weights --- docs/source/models/mnasnet.rst | 5 +++-- torchvision/models/mnasnet.py | 12 ++++-------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/docs/source/models/mnasnet.rst b/docs/source/models/mnasnet.rst index b4239be5c27..f902bc2ef38 100644 --- a/docs/source/models/mnasnet.rst +++ b/docs/source/models/mnasnet.rst @@ -11,8 +11,9 @@ Search for Mobile `__ paper. Model builders -------------- -The following model builders can be used to instanciate an MNASNet model, with or -without pre-trained weights. All the model builders internally rely on the +The following model builders can be used to instanciate an MNASNet model. Currently +only ``mnasnet0_5`` and ``mnasnet1_0`` can be instantiated with pre-trained weights. +All the model builders internally rely on the ``torchvision.models.mnasnet.MNASNet`` base class. Please refer to the `source code `_ for diff --git a/torchvision/models/mnasnet.py b/torchvision/models/mnasnet.py index 7e77cb90a3a..d9b1f9f44d2 100644 --- a/torchvision/models/mnasnet.py +++ b/torchvision/models/mnasnet.py @@ -306,10 +306,8 @@ def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool `_ paper. Args: - weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): The - pretrained weights to use. See - :class:`~torchvision.models.MNASNet0_75_Weights` below for - more details, and possible values. By default, no pre-trained + weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): + Currently no pre-trained weights available and by default no pre-trained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. @@ -358,10 +356,8 @@ def mnasnet1_3(*, weights: Optional[MNASNet1_3_Weights] = None, progress: bool = `_ paper. Args: - weights (:class:`~torchvision.models.MNASNet1_3_Weights`, optional): The - pretrained weights to use. See - :class:`~torchvision.models.MNASNet1_3_Weights` below for - more details, and possible values. By default, no pre-trained + weights (:class:`~torchvision.models.MNASNet1_3_Weights`, optional): + Currently no pre-trained weights available and by default no pre-trained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. From d89182f38208679c575543532cea1ff355a64bef Mon Sep 17 00:00:00 2001 From: Joao Gomes Date: Tue, 3 May 2022 18:44:41 +0100 Subject: [PATCH 2/4] Update torchvision/models/mnasnet.py Co-authored-by: Nicolas Hug --- torchvision/models/mnasnet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchvision/models/mnasnet.py b/torchvision/models/mnasnet.py index d9b1f9f44d2..e072ab63a82 100644 --- a/torchvision/models/mnasnet.py +++ b/torchvision/models/mnasnet.py @@ -306,8 +306,8 @@ def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool `_ paper. Args: - weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): - Currently no pre-trained weights available and by default no pre-trained + weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): Currently + no pre-trained weights are available and by default no pre-trained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. From c6cd7e70da46701765b28bb19290e479bd3001be Mon Sep 17 00:00:00 2001 From: Joao Gomes Date: Tue, 3 May 2022 18:46:15 +0100 Subject: [PATCH 3/4] Update torchvision/models/mnasnet.py Co-authored-by: Nicolas Hug --- torchvision/models/mnasnet.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/torchvision/models/mnasnet.py b/torchvision/models/mnasnet.py index e072ab63a82..942ac530db9 100644 --- a/torchvision/models/mnasnet.py +++ b/torchvision/models/mnasnet.py @@ -356,8 +356,8 @@ def mnasnet1_3(*, weights: Optional[MNASNet1_3_Weights] = None, progress: bool = `_ paper. Args: - weights (:class:`~torchvision.models.MNASNet1_3_Weights`, optional): - Currently no pre-trained weights available and by default no pre-trained + weights (:class:`~torchvision.models.MNASNet1_3_Weights`, optional): Currently + no pre-trained weights are available and by default no pre-trained weights are used. progress (bool, optional): If True, displays a progress bar of the download to stderr. Default is True. From be20b276bd40bcfb2e6a738c5846b8f451715371 Mon Sep 17 00:00:00 2001 From: Joao Gomes Date: Tue, 3 May 2022 18:56:00 +0100 Subject: [PATCH 4/4] apply ufmt --- torchvision/models/mnasnet.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/torchvision/models/mnasnet.py b/torchvision/models/mnasnet.py index 942ac530db9..7f4751f12a3 100644 --- a/torchvision/models/mnasnet.py +++ b/torchvision/models/mnasnet.py @@ -306,7 +306,7 @@ def mnasnet0_75(*, weights: Optional[MNASNet0_75_Weights] = None, progress: bool `_ paper. Args: - weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): Currently + weights (:class:`~torchvision.models.MNASNet0_75_Weights`, optional): Currently no pre-trained weights are available and by default no pre-trained weights are used. progress (bool, optional): If True, displays a progress bar of the