Skip to content

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

Closed
botcs wants to merge 2 commits into
junyanz:masterfrom
botcs:master
Closed

resize-convolution instead transposed-convolution to avoid checkerboard artifacts#64
botcs wants to merge 2 commits into
junyanz:masterfrom
botcs:master

Conversation

@botcs

@botcs botcs commented Jul 19, 2017

Copy link
Copy Markdown

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
Copy Markdown

Did you also try PixelShuffle?

@botcs

botcs commented Jul 27, 2017

Copy link
Copy Markdown
Author

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

ssnl commented Aug 18, 2017

Copy link
Copy Markdown
Collaborator

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

botcs commented Sep 11, 2017

Copy link
Copy Markdown
Author

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
Copy Markdown

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

@ssnl

ssnl commented Feb 9, 2018

Copy link
Copy Markdown
Collaborator

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

@beniroquai

Copy link
Copy Markdown

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

ssnl commented Feb 9, 2018

Copy link
Copy Markdown
Collaborator

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

@beniroquai

beniroquai commented Feb 10, 2018 via email

Copy link
Copy Markdown

@ssnl

ssnl commented Feb 10, 2018 via email

Copy link
Copy Markdown
Collaborator

@beniroquai

beniroquai commented Feb 11, 2018 via email

Copy link
Copy Markdown

@mrgloom

mrgloom commented Nov 18, 2019

Copy link
Copy Markdown

Comment thread models/networks.py
model += [nn.Conv2d(ngf * mult, ngf * mult * 2, kernel_size=3,
stride=2, padding=1),
stride=1, padding=1),
nn.MaxPool2d(2),

Copy link
Copy Markdown

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