Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resize-convolution instead transposed-convolution to avoid checkerboard artifacts #64

Closed
wants to merge 2 commits into from

Conversation

botcs
Copy link

@botcs botcs commented Jul 19, 2017

See the reasoning behind the reimplementation:
https://distill.pub/2016/deconv-checkerboard/

I became aware of some checkerboard effects while training the CyclicGAN network:
http://i.imgur.com/uTgsC2l.png

because it resembled this:
http://i.imgur.com/M8r47Bp.png

now it looks like this (during training on Van Gogh set):
http://i.imgur.com/wf7B9sT.png

@aman-tiwari
Copy link

Did you also try PixelShuffle?

@botcs
Copy link
Author

botcs commented Jul 27, 2017

I am now testing a transformer-net alternative with PixelShuffle using Fast-Neural-Style loss, CycleGAN still have some convergence issues, and the problem seems to be invariant of the capacity

@ssnl
Copy link
Collaborator

ssnl commented Aug 18, 2017

Thanks for your PR, @botcs !

I took a brief look at the code. This PR contains much more than what you have described. You should definitely clean up stuff like normalization, video, printing, etc.

Some questions:

  1. Why change strided Conv to Conv+MaxPooling in downsampling?
  2. Why use bilinear interpolation? The post authors suggest nearest neighbor gives them best results. What's the reasoning behind your choice? And maybe make it an option?

By the way, nn.Upsample is available now. You may also want to uncomment this line and remove the now deprecated nn.UpsamplingBilinear2d? :)

@botcs
Copy link
Author

botcs commented Sep 11, 2017

Yeah, sorry for the inconvenience I will clean the code up in two weeks, and make another PR, with all the listed details - if that is acceptable for you

@beniroquai
Copy link

Is there any activity on this topic? I'm also interested to implement this feature - at least to get it work ;-)

@ssnl
Copy link
Collaborator

ssnl commented Feb 9, 2018

@beniroquai I have an implementation here: #190 (bottom of the thread)

@beniroquai
Copy link

Wow that was quick! Thanks a lot. Did you plan to make a PR in this repo as well? So the only thing is to exchange the resnet code part, right?
Will try it! Eager to see if this is solving my issues ;)

@ssnl
Copy link
Collaborator

ssnl commented Feb 9, 2018

@beniroquai that's right. Hope that it helps! :)

@beniroquai
Copy link

beniroquai commented Feb 10, 2018 via email

@ssnl
Copy link
Collaborator

ssnl commented Feb 10, 2018 via email

@beniroquai
Copy link

beniroquai commented Feb 11, 2018 via email

@mrgloom
Copy link

mrgloom commented Nov 18, 2019

@@ -149,21 +163,40 @@ def __init__(self, input_nc, output_nc, ngf=64, norm_layer=nn.BatchNorm2d, use_d
for i in range(n_downsampling):
mult = 2**i
model += [nn.Conv2d(ngf * mult, ngf * mult * 2, kernel_size=3,
stride=2, padding=1),
stride=1, padding=1),
nn.MaxPool2d(2),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi! Why Pooling is used for avoiding checkerboard artifacts if
" Max pooling was previously linked to high-frequency artifacts in [12].)" https://distill.pub/2016/deconv-checkerboard/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants