sunshineatnoon/Paper-Implementations

runtime error when training with single channel

Yuekchoi opened this issue · 0 comments

When I changed the input_nc and output_nc with 1,it came out such problem:

Traceback (most recent call last):

File "CycleGAN.py", line 209, in
outA = D_A(real_A)
File "/home/ccc/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/ccc/cchoi/Paper-Implementations/cycleGAN/model/Discriminator.py", line 56, in forward
out = self.layer1(x)
File "/home/ccc/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/ccc/anaconda2/lib/python2.7/site-packages/torch/nn/modules/container.py", line 91, in forward
input = module(input)
File "/home/ccc/anaconda2/lib/python2.7/site-packages/torch/nn/modules/module.py", line 491, in call
result = self.forward(*input, **kwargs)
File "/home/ccc/anaconda2/lib/python2.7/site-packages/torch/nn/modules/conv.py", line 301, in forward
self.padding, self.dilation, self.groups)
RuntimeError: Given groups=1, weight[64, 1, 4, 4], so expected input[1, 3, 512, 512] to have 1 channels, but got 3 channels instead
Exception NameError: "global name 'FileNotFoundError' is not defined" in <bound method _DataLoaderIter.del of <torch.utils.data.dataloader._DataLoaderIter object at 0x2ac957b05d50>> ignored
Exception NameError: "global name 'FileNotFoundError' is not defined" in <bound method _DataLoaderIter.del of <torch.utils.data.dataloader._DataLoaderIter object at 0x2ac957b33550>> ignored

How could I train the dataset with just 1channel?