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

Hi there!
How to fix this issue? I am using torchvision==0.12.0.


transformations = transforms.Compose([torchvision.transforms.Scale(224),
transforms.CenterCrop(224), transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])])

torchvision.transforms.Scale was deprecated in favor of torchvision.transforms.Resize so use the latter transformation in current releases.


Hello Sir,
How about, torchvision.transforms.ElasticTransform

Having an error: AttributeError: module ‘torchvision.transforms’ has no attribute ‘ElasticTransform’

ElasticTransform was added in this PR in June so ~4 months ago and you might need to update torchvision to the nightly release.

Thanks a lot for your response