I have one channel images and want to add them to the tensorboard logger by using writer.add_image
, as follows:
generated_images_to_show = torch.cat(gtimage_cpu, predimage_cpu), dim=0)
gen_image_grid = make_grid(generated_images_to_show .unsqueeze(1), nrow=inputs.size(0), padding=6, normalize=False)
writer.add_image('Validation Gen Comparison', gen_image_grid, epoch)
My generated images have one channel and I need to plot them with cmap= 'hsv'
but no cmap
feature is available in add_image
. In this case, what should I do? I am interested in viewing the results in tensorboard
only.
One solution would be converting the images to RGB-channels and then use cmap=hsv
and log the converted images to the tensorboard
, is there a different (perhaps more efficient) solution?
Donya Khaledyan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.