Lotayou / Face-Renovation

Official repository of the paper "HiFaceGAN: Face Renovation via Collaborative Suppression and Replenishment".
https://arxiv.org/abs/2005.05005
GNU General Public License v3.0
284 stars 49 forks source link

why set model mode as train() instead of eval() in test? #31

Closed ningbende closed 3 years ago

ningbende commented 3 years ago

I noticed the comment ,but why ?

20200218 Critical Bug

# When model is set to eval mode, the generated image
# is not enhanced whatsoever, with almost 0 residual
# when turned to training mode, it behaves as expected.
###
#model.eval()
model.netG.eval()
#model.netG.train()
Lotayou commented 3 years ago

See #12

but I notice that you have mentioned a bug in your code that the predicted images are not shown as expected when we set the model to eval model.

This is a Pytorch bug where the spectral normalization layer in SPADE is not working under eval mode in dataparallel. A possible fix is suggested at here