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

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

Thanks

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])])
 
 model.cuda(gpu)

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

1 Like