contrastive-unpaired-translation
contrastive-unpaired-translation copied to clipboard
Seems to not work with --input_nc 1 (grayscale)
When I try to run the training code with --input_nc 1 and --output_nc 1 (grayscale img to img conversion), the script fails with:
RuntimeError: Given groups=1, weight of size [64, 1, 7, 7], expected input[4, 3, 262, 262] to have 1 channels, but got 3 channels instead
I checked the get_transforms
function call in the unaligned_dataset
class and don't see any mention of single image preprocessing. get_transforms
has an argument grayscale
that is not set when the function is called. Switching this line to
transform = get_transform(modified_opt, grayscale=True)
worked for me for single channel training.
brilliant ! thanks for the tip @adodd202
Thank you, was having the same issue !
When I try to run the training code with --input_nc 1 and --output_nc 1 (grayscale img to img conversion), the script fails with:
RuntimeError: Given groups=1, weight of size [64, 1, 7, 7], expected input[4, 3, 262, 262] to have 1 channels, but got 3 channels instead
I checked the
get_transforms
function call in theunaligned_dataset
class and don't see any mention of single image preprocessing.get_transforms
has an argumentgrayscale
that is not set when the function is called. Switching this line totransform = get_transform(modified_opt, grayscale=True)
worked for me for single channel training.
Great, that's the question. Thank you