Hi everyone,
I’m struggling with the following issue, and can’t find a possible explanation (I’m quite the pytorch amateur, so please forgive me for not finding possible obvious solutions).
I’m feeding MR images to a 3D Unet, and reshape the already normalized numpy array image like this:

imagefinal=(image.reshape(1,1, image.shape[0], image.shape[1], image.shape[2]))

after which I convert it to a tensor using

tensor_x = torch.from_numpy(imagefinal).float()

However, using

print(imagefinal.max())


print(torch.max(tensor_x))

returns

1.0
tensor(2652589.7500, device=‘cuda:0’)
1.0
tensor(4033200., device=‘cuda:0’)
1.0
tensor(3447660.5000, device=‘cuda:0’)
1.0
tensor(3224289., device=‘cuda:0’)
1.0

Do you have any idea why the maximum value of the array would change to very large values after converting it to a tensor? I’ve tried  forcing the tensor to be of different datatypes with no success. Is there something obvious I’m missing here?
Thanks in advance for your help!