Hi,
when I try to normalize an image with transforms.Normalize I get this error:
“RuntimeError: expected device cpu but got device cuda:0”
I know that my model is on the GPU and I want that, how to I change the device for the normalization within my dataset class?
norm = Normalize([0.5, 0.5, 0.5], [1, 1, 1])
transform_list_signal += [transforms.ToTensor()]
transform_list_signal.append(norm)
transform_list += [transforms.ToTensor()]
apply_transformation_signal = Compose(transform_list_signal)
apply_transformation = Compose(transform_list)
signal_im_transformed = apply_transformation_signal(signal_im)
target_im_transformed = apply_transformation(target_im)