Skip to content

fix: ConfLoss returns Python int 0 for empty valid masks - #109

Open
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/losses-confloss-returns-python-int-0-for
Open

fix: ConfLoss returns Python int 0 for empty valid masks#109
andrewwhitecdw wants to merge 1 commit into
NVlabs:mainfrom
andrewwhitecdw:bugfix/losses-confloss-returns-python-int-0-for

Conversation

@andrewwhitecdw

Copy link
Copy Markdown

Problem

fix: ConfLoss returns Python int 0 for empty valid masks

Fix

Replace:

        conf_loss1 = conf_loss1.mean() if conf_loss1.numel() > 0 else 0
        conf_loss2 = conf_loss2.mean() if conf_loss2.numel() > 0 else 0

with:

        conf_loss1 = conf_loss1.mean() if conf_loss1.numel() > 0 else conf_loss1.new_zeros(())
        conf_loss2 = conf_loss2.mean() if conf_loss2.numel() > 0 else conf_loss2.new_zeros(())

Files changed

  • dust3r/losses.py

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

Successfully merging this pull request may close these issues.

1 participant