Torchvision.transforms' has no attribute 'Resize'


(shiv) #1

import torchvision.transforms as transforms
transform=transforms.Compose([transforms.Resize(100),
transforms.ToTensor()
])

And i’m getting following error :

AttributeError: ‘module’ object has no attribute 'Resize’

Installed torch-1.0.1.post2 torchvision-0.2.1


(Xiaoyu Song) #2

Hi, I tried your code, it works fine, check your other code, I suppose you might have defined transforms somewhere else


(shiv) #3

Thanks for testing it… please can you share the torch and torchvision installed version


(Jingbo Fan) #4

Maybe you’re not using the version you wish to use. Check the version in shell.

import torch
print(torch.__version___)