Firstly you have not applied the defined transformation.
apply the transformation.
second, if you don’t want to apply the transformation,
change the tensor type using the torch.from_numpy(img).float
show output if you still got any errors.