Open Davegdd opened 2 years ago
I am not sure if our current code supports visualization of 6-channel images. Two potential fixes: (1) you can try using the wandb visualization and see if they handle it or not. (2) you may want to modify the visualizer code. We often call the tensor2im function (here: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/util/visualizer.py#L41) , which only works for 1 channel or 3 channel images. You may want to modify it. https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/util/util.py#L9
I am not sure if our current code supports visualization of 6-channel images. Two potential fixes: (1) you can try using the wandb visualization and see if they handle it or not. (2) you may want to modify the visualizer code. We often call the tensor2im function (here: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/util/visualizer.py#L41) , which only works for 1 channel or 3 channel images. You may want to modify it. https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/master/util/util.py#L9
Thanks a lot for pointing me to that. I was able to modify the tensor2im and it's training now. For anyone with the same issue I just included the following at the same indentation level as # grayscale to RGB in tensor2im:
if image_numpy.shape[0] == 6:
image_numpy, b = np.vsplit(image_numpy, 2)
This will just split the two input images that were concatenated to feed the network and return one of them for visualization as real A for reference.
Hello and thanks a lot for this software and taking the time to read my issue.
I'm trying to train pix2pix to go from a combination of 2 RGB images (6 input channels) to 1 RGB image (3 output channels). My dataset looks like this (same portion of the sky in optical, ultraviolet and infrared (false-coloured), respectively):
Setting --input_nc 6 and modifying getitem in aligned_dataset to be able to input 2 images (6 channels) like this:
I get the following error after epoch 1:
Are there any other modifications needed beyond the ones in dataset? What would they be? Thanks a lot for any assistance.