There is an image stored in image_tensor (image_tensor of size (3,256,512), storing values in the interval 0,255) which I would like to display in Tensorboard (TensorboardX for PyTorch, more specifically) via the add_image() function for SummaryWriter. When I add the image to the Tensorboard via writer.add_image("color_image",image_tensor,self.step), the colors are inverted.
When I write the image to a file via scipy.misc.imsave("/write/to/path/image.png",np.transpose(image_tensor.data.cpu().numpy(),(1,2,0))), the image is perfectly fine.
Only thing I change for the second line is changing CxHxW to HxWxC, but I don't think that this is the root of this color inversion issue. What might be the problem?