Hello,
l have a jpeg image of (3,224,244). l need to put it in a variable image but it needs to be convert to a tensor (1,3,244,224) to train a Resnet152.
l did the following :
from PIL import Image
img_path="/data/v_PlayingSitar_g25_c04_0256.jpeg"
#image = torch.Tensor(1,3, 224, 224).normal_()
image = Image.open(img_path)
image = Variable(image)
l got the following error :
RuntimeError: Variable data has to be a tensor, but got JpegImageFile
Thank you