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

why setting evaluate mode in test.lua yeilding black images? #34

Closed
sunshineatnoon opened this issue Dec 19, 2016 · 2 comments
Closed

Comments

@sunshineatnoon
Copy link

Thanks for open sourcing this great project.
I saw this line of code in test.lua: --netG:evaluate(), I guess this is the code that enables dropout at testing time. I tried to set evaluate mode when testing, but the model generates black images.

Why is enabling dropout important when testing? Or is it possible that the black images are caused by BN layers, Anybody has insight on this? Thanks.

@phillipi
Copy link
Owner

Yeah, setting the net to evaluate mode does two things: 1) enables dropout, 2) makes batchnorm use aggregated training set statistics. I'm not entirely sure why it results in black images, but I think it's more due to 1 than to 2 (or possibly the interaction of the two effects).

The goal of enabling dropout during testing was to make the outputs stochastic (though it only has a very minor effect). Also, our strategy was to run the net identically during training and test, to avoid any "domain gap" between the two phases. This makes a big difference for batchnorm. It could be also that the way we used dropout causes a problematic gap if you turn it off at test time.

@Quasimondo
Copy link

Maybe worth mentioning: if you are creating animations or videos with pix2pix I recommend to un-comment that line and thus disable dropout in test mode. This will give you much better frame-to-frame consistency and reduce flickering a lot.

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

No branches or pull requests

3 participants