eriklindernoren / PyTorch-GAN

PyTorch implementations of Generative Adversarial Networks.
MIT License
16.39k stars 4.07k forks source link

CycleGAN error in models.py #128

Open cyduoot opened 4 years ago

cyduoot commented 4 years ago

In the class GeneratorResNet, in line 49 and line 82, the parameter of nn.ReflectionPad2d should be namely3 but not channels. It should be decided by the kernel size but not the channels.

boyden commented 4 years ago

Yeah, It should be 3 to keep the same shape after using nn.Conv2d(channels, out_features, 7)

Healingl commented 2 years ago

In the class GeneratorResNet, in line 49 and line 82, the parameter of nn.ReflectionPad2d should be namely3 but not channels. It should be decided by the kernel size but not the channels.

This change is efficient and correct, especially for multi-channels images (e.g. 1x256x256 or 2x256x256).