Skip to content

No grad_fn for "self.loss_G_chamfer2" #22

@gerwang

Description

@gerwang

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

self.loss_G_chamfer2 = (dt1gt[(fake_B_gray<0)&(fake_B_gray_line1<0)].sum() + dt2gt[(fake_B_gray>=0)&(fake_B_gray_line2>=0)].sum()) / bs * self.opt.lambda_chamfer2

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions