grey-eye / talking-heads

Our implementation of "Few-Shot Adversarial Learning of Realistic Neural Talking Head Models" (Egor Zakharov et al.)
GNU General Public License v3.0
593 stars 109 forks source link

Nan issue #32

Closed mikirui closed 5 years ago

mikirui commented 5 years ago

Hi @MrCaracara ,

I try your latest code, but found the training would easily get Nan during about first 40 - 50 iteration in the first epoch, would you have any suggestions for solving this?

mikirui commented 5 years ago

It seems it can be solved by the modification below: In network/components.py AdaIn() function: std_feat = (torch.std(feature, dim=2) + self.eps).view(B, C, 1) can be written as: std_feat = torch.var(feature, dim=2) + self.eps std_feat = std_feat.sqrt().view(B, C, 1)