Pytorch-cyclegan-and-pix2pix: Grid-like image after training cycle GAN

Created on 16 Aug 2017  路  4Comments  路  Source: junyanz/pytorch-CycleGAN-and-pix2pix

When training the cycle-gan, I got some grid like images like the following, I think that is due to the up sampling problem, is anyone met this problem and have solutions?
Similar issue https://github.com/fchollet/keras/issues/3940.
screen shot 2017-08-16 at 9 02 21 am

Thanks a lot!

Most helpful comment

Could be related to this issue: https://distill.pub/2016/deconv-checkerboard/

The solution proposed there is to replace deconvolution with upsampling followed by stride 1 convolution. The cost is a naive implementation will be ~4 times as slow (but you could make it almost as fast with a smarter implementation, see the matrices in the distill post).

Another partial solution is to use a combination of kernel sizes and strides that minimize the unequal sampling problem (e.g., use kernel size 4 and stride 2; you can see the effect in the interactive widget on the distill post).

In my experience, the artifacts usually go away with enough training, as the adversary can notice these artifacts and eventually the generator will adjust its weights to avoid them, even with a naive architecture. The architecture tricks above could help get to good solutions faster, but in general we found them to be unnecessary if you just train long enough.

All 4 comments

Could be related to this issue: https://distill.pub/2016/deconv-checkerboard/

The solution proposed there is to replace deconvolution with upsampling followed by stride 1 convolution. The cost is a naive implementation will be ~4 times as slow (but you could make it almost as fast with a smarter implementation, see the matrices in the distill post).

Another partial solution is to use a combination of kernel sizes and strides that minimize the unequal sampling problem (e.g., use kernel size 4 and stride 2; you can see the effect in the interactive widget on the distill post).

In my experience, the artifacts usually go away with enough training, as the adversary can notice these artifacts and eventually the generator will adjust its weights to avoid them, even with a naive architecture. The architecture tricks above could help get to good solutions faster, but in general we found them to be unnecessary if you just train long enough.

thanks a lot~ got it

I've run into problems changing the sampling to kernel size 4 for the sampling. @phillipi

How did you go about changing that setting in the networks.py file?

@mrluker It depends on which generator you are using, for the resnet generator, you can change the network architectures here; for the u-net generator, you can edit here. You can change the kernel_size in each function.

Was this page helpful?
0 / 5 - 0 ratings