Pytorch-cyclegan-and-pix2pix: Parameter selection for gray image?

Created on 12 Feb 2019  路  3Comments  路  Source: junyanz/pytorch-CycleGAN-and-pix2pix

I am using cycle GAN with UNet generator to translation from T1 to T2 in the medical image. Both are gray images with size of 1x256x256 (CxHxW).

t1_t2

I am wondering about the parameters opt.input_nc, opt.output_nc, opt.ngf in the

https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix/blob/690470c80bb7021d96c9d3f82e416e633dbb2da3/models/cycle_gan_model.py#L73

What should I choose? In my opinion, it should be 1 for opt.input_nc=1, opt.output_nc=1, and opt.ngf=8. Thanks

Most helpful comment

We do not have a definite answer for that. Resnet tends to make less changes and work better when two domains are similar.

All 3 comments

You can set --input_nc 1 and --output_nc and leave opt.ngf as default. You may want to try Resnet architecture as well.

Thanks. It worked now. Just for your suggestion, unet has more parameters and larger checkpoints MB. What is the benefit of using resnet comparison with unet? When should I use resnet?

We do not have a definite answer for that. Resnet tends to make less changes and work better when two domains are similar.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaureenZOU picture MaureenZOU  路  4Comments

filmo picture filmo  路  3Comments

JamesChenChina picture JamesChenChina  路  3Comments

Overtown picture Overtown  路  3Comments

lyhangustc picture lyhangustc  路  5Comments