yiranran / APDrawingGAN

Code for APDrawingGAN: Generating Artistic Portrait Drawings from Face Photos with Hierarchical GANs (CVPR 2019 Oral)
Apache License 2.0
788 stars 147 forks source link

No grad_fn for "self.loss_G_chamfer2" #22

Open gerwang opened 3 years ago

gerwang commented 3 years ago

Hello, Thanks for your great work! I'm pretty interested in your distance transform loss. But when I want to test the loss separately, I find there is no grad_fn for self.loss_G_chamfer2 https://github.com/yiranran/APDrawingGAN/blob/2b0173aa9e665f005770ca6429693147b9fb541c/models/apdrawing_gan_model.py#L308 Since real_B_gray is input label and doesn't require grad, I believe self.loss_G_chamfer2 should have no grad_fn. So what is the purpose to calculate it? Or is it redundant?