Unverified Commit 2907c494 authored by YosuaMichael's avatar YosuaMichael Committed by GitHub
Browse files

Update the expected removal date for several deprecated API for release v0.14 (#6654)

* Update the expected removal date for several deprecated API

* Revert the change in models/_utils.py

* Remove removal date on pretrained=True

* Update another message related to pretrained=True

* Also update the warning in kwonly_to_pos_or_kw decorator

* Update remaining message in _utils.py
parent 61f20323
...@@ -134,7 +134,7 @@ def kwonly_to_pos_or_kw(fn: Callable[..., D]) -> Callable[..., D]: ...@@ -134,7 +134,7 @@ def kwonly_to_pos_or_kw(fn: Callable[..., D]) -> Callable[..., D]:
keyword_only_kwargs = dict(zip(keyword_only_params, keyword_only_args)) keyword_only_kwargs = dict(zip(keyword_only_params, keyword_only_args))
warnings.warn( warnings.warn(
f"Using {sequence_to_str(tuple(keyword_only_kwargs.keys()), separate_last='and ')} as positional " f"Using {sequence_to_str(tuple(keyword_only_kwargs.keys()), separate_last='and ')} as positional "
f"parameter(s) is deprecated since 0.13 and will be removed in 0.15. Please use keyword parameter(s) " f"parameter(s) is deprecated since 0.13 and may be removed in the future. Please use keyword parameter(s) "
f"instead." f"instead."
) )
kwargs.update(keyword_only_kwargs) kwargs.update(keyword_only_kwargs)
...@@ -206,13 +206,13 @@ def handle_legacy_interface(**weights: Tuple[str, Union[Optional[W], Callable[[D ...@@ -206,13 +206,13 @@ def handle_legacy_interface(**weights: Tuple[str, Union[Optional[W], Callable[[D
if not pretrained_positional: if not pretrained_positional:
warnings.warn( warnings.warn(
f"The parameter '{pretrained_param}' is deprecated since 0.13 and will be removed in 0.15, " f"The parameter '{pretrained_param}' is deprecated since 0.13 and may be removed in the future, "
f"please use '{weights_param}' instead." f"please use '{weights_param}' instead."
) )
msg = ( msg = (
f"Arguments other than a weight enum or `None` for '{weights_param}' are deprecated since 0.13 and " f"Arguments other than a weight enum or `None` for '{weights_param}' are deprecated since 0.13 and "
f"will be removed in 0.15. " f"may be removed in the future. "
f"The current behavior is equivalent to passing `{weights_param}={default_weights_arg}`." f"The current behavior is equivalent to passing `{weights_param}={default_weights_arg}`."
) )
if pretrained_arg: if pretrained_arg:
...@@ -250,7 +250,7 @@ def _ovewrite_value_param(param: str, actual: Optional[V], expected: V) -> V: ...@@ -250,7 +250,7 @@ def _ovewrite_value_param(param: str, actual: Optional[V], expected: V) -> V:
class _ModelURLs(dict): class _ModelURLs(dict):
def __getitem__(self, item): def __getitem__(self, item):
warnings.warn( warnings.warn(
"Accessing the model URLs via the internal dictionary of the module is deprecated since 0.13 and will " "Accessing the model URLs via the internal dictionary of the module is deprecated since 0.13 and may "
"be removed in 0.15. Please access them via the appropriate Weights Enum instead." "be removed in the future. Please access them via the appropriate Weights Enum instead."
) )
return super().__getitem__(item) return super().__getitem__(item)
...@@ -4,7 +4,7 @@ import torch ...@@ -4,7 +4,7 @@ import torch
warnings.warn( warnings.warn(
"The 'torchvision.transforms._functional_video' module is deprecated since 0.12 and will be removed in 0.14. " "The 'torchvision.transforms._functional_video' module is deprecated since 0.12 and will be removed in the future. "
"Please use the 'torchvision.transforms.functional' module instead." "Please use the 'torchvision.transforms.functional' module instead."
) )
......
...@@ -20,7 +20,7 @@ __all__ = [ ...@@ -20,7 +20,7 @@ __all__ = [
warnings.warn( warnings.warn(
"The 'torchvision.transforms._transforms_video' module is deprecated since 0.12 and will be removed in 0.14. " "The 'torchvision.transforms._transforms_video' module is deprecated since 0.12 and will be removed in the future. "
"Please use the 'torchvision.transforms' module instead." "Please use the 'torchvision.transforms' module instead."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment