junyanz / pytorch-CycleGAN-and-pix2pix

Image-to-Image Translation in PyTorch
Other
23.05k stars 6.31k forks source link

Which setting is better for cycleGAN generator: larger batch size, larger crop size...? #546

Closed John1231983 closed 5 years ago

John1231983 commented 5 years ago

Thanks for sharing the interesting project!

Because I have limited GPU and train the cycleGAN on 3D problem. I have to customize the hyperparameters:

  1. Reduce the crop size (128x128x128 --> 32x32x32) that allows increasing the batch size (1-->4)
  2. Reduce the batch size (4-->1) that only allows training on batch size of 1-->instance norm
  3. Reduce the depth network in the generator, it means using a simple generator network: so I can train on crop size of larger batch size and larger crop size

Which option do you prefer?

taesungp commented 5 years ago

We don't have much experience in 3D.

But in case of 2D images, reducing generator depth almost did no harm to the image quality, so I recommend trying the third approach first. You can use resnet_6blocks instead of resnet_9blocks.

Regarding batch size, it's still an open problem. In many cases, large batch size helps, such as in BigGAN, but in CycleGAN we could not see improvement with larger batch size. But this was not fully investigated, and for some problems large batch size might help.