Inverted colors in Tensorboard SummaryWriter add_image() function
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?

I had a similar problem, where I was also unable to track the problem. The solution that worked for me but is unfortunately a little bit cumbersome is:
Take your image and plug it into a matplotlib figure then use add_figure.
For example:
fig, ax =  plt.subplots(2,3)
# add your subplots with some images eg.
ax[0,0].imshow(image_1)
# etc.
writer_semisuper.add_figure(&quot;testfig&quot;, fig, 0)

This shows exactly the same plot that you created, but with lower resolution. So if your plot works in jupyter or saved on disk it should also work in tensorboard.
