junyanz / pytorch-CycleGAN-and-pix2pix

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

Input size 32x32 #952

Open savaandreioct opened 4 years ago

savaandreioct commented 4 years ago

I am trying to create a model with pix2pix architecture (photo to label) that will take as input a 32x32 picture. I added in define_G: elif netG == 'unet_32': net = UnetGenerator (input_nc, output_nc, 5, ngf, norm_layer = norm_layer, use_dropout = use_dropout) I changed nfg and nfd to 4.

I have some doubts:

  1. Are the above changes ok? How should I choose nfg and nfd?
  2. If I'm not ok, how can I change the code for a 32x32 input?
  3. What exactly does G_GAN, G_L1, D_real, D_fake mean?

Thank you very much

junyanz commented 4 years ago

1 & 2. You can change num_downs. No need to change ndf and ngf.

  1. G_GAN: GAN loss for the generator; G_L1: L1 loss for the generator; D_real: GAN loss for the discriminator on real images; D_fake: GAN loss for the discriminator on fake images. See the code's comments for more details.
savaandreioct commented 4 years ago

Hello @junyanz,

Thanks for your prompt answer. Another question that I missed:

What type of discriminator should I use giving that as input I have a 32x32 img?

junyanz commented 4 years ago

You can still use --netD n_layers and use fewer layers by specifying --n_layers_D.

Shawye commented 1 year ago

Hi there, I am a beginner and try to build up a model with 48*48 input but meet some problems. Could you please send me the all parameters you use for running train.py?

Rjaat commented 4 weeks ago

Hi @Shawye all the default parameters can be find inside base_options.py and train_options.py itself