sorry I think the error is from transforms.Normalize, and the ToTensor() function doesn’t convert the img to tensor. you can break up the transforms.Compose into step-by-step, and use print(type(img)) to see what type is it.