Solved by eqy in post #3 
              
              
                Does it work if you try to save an image in tensor format (e.g., channels first, in range (0, 1.0), dtype float)? 
You can call the to tensor transformation to do this if you do not have it readily available in that format: 
https://pytorch.org/vision/stable/_modules/torchvision/transforms/functiona…