Ah I missed the uint8 line as Jupyter Notebooks doesn’t support np.astype but I’ve replaced it with img.astype(np.uint8) and it works perfectly now.
So for anyone who comes across this thread, here is the complete code:
img[img != img] = 0
img -= img.min()
img *= 255/img.max()
img = img.astype(np.uint8)
transform = transforms.Compose([transforms.ToTensor(),transforms.Normalize([0], [1])])
tensor = transform(img.reshape(*img.shape,1)).float()

And the final image after transform:

Many thanks as always