Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with layers.py at line 210 #135

Open
totesarana opened this issue Jun 21, 2023 · 0 comments
Open

Issues with layers.py at line 210 #135

totesarana opened this issue Jun 21, 2023 · 0 comments

Comments

@totesarana
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant