taesungp / contrastive-unpaired-translation

Contrastive unpaired image-to-image translation, faster and lighter training than cyclegan (ECCV 2020, in PyTorch)

Home Page:https://taesung.me/ContrastiveUnpairedTranslation/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CUT is not working with grayscale images.

AlbertoJBC opened this issue · comments

Hi!
I was trying to execute CUT for domain adaptation in grayscale images but, at the time the models are created, an error raises telling that the input has 3 channels instead of 1 (as specified in options with input_nc=1). I took a look to the code and I think I found the source of this bug. It seems that, when an unaligned dataset is created, the images are converted to RGB and, then, the necessary transforms are applied. However, the function get_transform() never changes its argument 'grayscale' from the default (False), depending on the specified input_nc option, so it never returns images with only 1 channel and they always remain having 3 channels.
This is my first time submitting an issue to GitHub, so I am not sure about what to do if I think I know the source of the error, my apologies for that. Maybe this bug should be reviewed by some administrator. I hope I could help! Thank you.

Yes, I'm having the same problem, after I change the input&output_nc to 1 it still reports an error mentioning that the training block size is inconsistent.(I can make sure my images are 8 bit)

CUT can not run unaligned dataset?