From 78a6221e200f076e1a36414e3e975605e8b991fc Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Wed, 9 Feb 2022 11:12:48 +0000 Subject: [PATCH] properly deprecate legacy implementation -- bis (#5391) * More deprecations * update message * typo --- torchvision/datasets/voc.py | 3 ++- torchvision/models/mobilenetv3.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/torchvision/datasets/voc.py b/torchvision/datasets/voc.py index b8d33e5c97d..64437caed5b 100644 --- a/torchvision/datasets/voc.py +++ b/torchvision/datasets/voc.py @@ -80,7 +80,8 @@ def __init__( if year == "2007-test": if image_set == "test": warnings.warn( - "Acessing the test image set of the year 2007 with year='2007-test' is deprecated. " + "Accessing the test image set of the year 2007 with year='2007-test' is deprecated " + "since 0.12 and will be removed in 0.14. " "Please use the combination year='2007' and image_set='test' instead." ) year = "2007" diff --git a/torchvision/models/mobilenetv3.py b/torchvision/models/mobilenetv3.py index 97239bea8ad..711888b7c8b 100644 --- a/torchvision/models/mobilenetv3.py +++ b/torchvision/models/mobilenetv3.py @@ -29,8 +29,8 @@ def __init__(self, input_channels: int, squeeze_factor: int = 4): self.relu = self.activation delattr(self, "activation") warnings.warn( - "This SqueezeExcitation class is deprecated and will be removed in future versions. " - "Use torchvision.ops.misc.SqueezeExcitation instead.", + "This SqueezeExcitation class is deprecated since 0.12 and will be removed in 0.14. " + "Use torchvision.ops.SqueezeExcitation instead.", FutureWarning, )