Skip to content

Issues with layers.py at line 210 #135

@waterdeepmage

Description

@waterdeepmage

When you do

loss = classify_loss,
then adding regression loss to the loss tensor, you will also modify classify_loss at the same time.

This is because the assign operation makes the loss and classify_loss share the same memory address. You should either do deep copy, or simply return classify_loss + torch.sum(torch.stack(regress_losses)) instead of creating a new loss tensor and return it

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