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

Why can the model correctly predict empty occupancies? #122

Open
lnSong opened this issue Feb 12, 2025 · 1 comment
Open

Why can the model correctly predict empty occupancies? #122

lnSong opened this issue Feb 12, 2025 · 1 comment

Comments

@lnSong
Copy link

lnSong commented Feb 12, 2025

Thank you for your work!
The code occ[..., 3][occ[..., 3] == 0] = 255 sets empty occupancies to 255,
and the loss criterion is defined as:
criterion = nn.CrossEntropyLoss(
ignore_index=255, reduction="mean"
)
Since the loss ignores the index 255, why is the model still able to correctly infer empty occupancies?

@lnSong
Copy link
Author

lnSong commented Mar 3, 2025

non-occupied is trained as it is labeled as 0
def multiscale_supervision(gt_occ, ratio, gt_shape):
'''
change ground truth shape as (B, W, H, Z) for each level supervision
'''

gt = torch.zeros([gt_shape[0], gt_shape[2], gt_shape[3], gt_shape[4]]).to(gt_occ.device).type(torch.float) 
for i in range(gt.shape[0]):
    coords = gt_occ[i][:, :3].type(torch.long) // ratio
    gt[i, coords[:, 0], coords[:, 1], coords[:, 2]] =  gt_occ[i][:, 3]

return gt

@lnSong lnSong closed this as completed Mar 3, 2025
@lnSong lnSong reopened this Mar 3, 2025
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