I tried to modify this example code https://pytorch.org/tutorials/beginner/dcgan_faces_tutorial.html 3 of DCGAN for my own dataset. The exmple code is for RGB image, but my data is grayscale image. Therefore, I set the value of number of channels ‘nc’ as 1. However, when I tried running the program, i got thid error:
RuntimeError: Given groups=1, weight of size 64 1 4 4, expected input[128, 3, 64, 64] to have 1 channels, but got 3 channels instead. I do know that its a problem about number of channels but I have no idea what else should I change to solve this error.
Any help would be appreciated!