Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'torchvision.transforms' has no attribute 'Scale' #5927

Closed
BassamAliBhatti opened this issue May 1, 2022 · 1 comment

Comments

@BassamAliBhatti
Copy link

BassamAliBhatti commented May 1, 2022

🐛 Describe the bug

AttributeError: module 'torchvision.transforms' has no attribute 'Scale'

I am using torch version and this scale error is coming in my code in line as
transform_list.append(transforms.Scale(osize, method)) #Code line
AttributeError: module 'torchvision.transforms' has no attribute 'Scale'

Versions

transform_list.append(transforms.Scale(osize, method))
AttributeError: module 'torchvision.transforms' has no attribute 'Scale'

cc @vfdev-5 @datumbox

@pmeier
Copy link
Collaborator

pmeier commented May 2, 2022

The Scale transform has been deprecated since 0.2.0 (> 4 years) and was finally removed in 0.12.0 (#5386). Please follow the warning it emitted in the mean time and use transforms.Resize.

class Scale(Resize):
"""
Note: This transform is deprecated in favor of Resize.
"""
def __init__(self, *args, **kwargs):
warnings.warn("The use of the transforms.Scale transform is deprecated, " +
"please use transforms.Resize instead.")
super(Scale, self).__init__(*args, **kwargs)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants