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

A bug in transfusion_head.py code, in case that pc_range is rectangle #73

Open
zzwforever opened this issue Mar 25, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@zzwforever
Copy link

zzwforever commented Mar 25, 2024

Hello @chenshi3
When I trained with this project, I found that the training process loss of the model was difficult to converge when pc_range was set to a rectangle. After checking, I in the "OpenPCDet/pcdet/models/dense_heads/transfusion_head py" file found an error. The specific errors in lines 366-369 are as follows:

    center = torch.tensor([coor_x, coor_y], dtype=torch.float32, device=device)
    center_int = center.to(torch.int32)
    # centernet_utils.draw_gaussian_to_heatmap(heatmap[gt_labels_3d[idx]], center_int, radius)
    centernet_utils.draw_gaussian_to_heatmap(heatmap[gt_labels_3d[idx]], center_int[[1,0]], radius)

Line 369 incorrectly sets the x and y coordinate order for center_int. When the pc_range is square, this situation will not produce an error, but when it is rectangular, it will be exposed. The correct code should be line 368 of the comment, why did you comment it out and change it to line 369

@Haiyang-W
Copy link
Owner

Thanks very much! I'll check this part and fix it as soon as possible. :)
Thanks a lot for your contribution. :)

@Haiyang-W Haiyang-W added the bug Something isn't working label Mar 26, 2024
@chenshi3
Copy link
Collaborator

Hello @chenshi3 When I trained with this project, I found that the training process loss of the model was difficult to converge when pc_range was set to a rectangle. After checking, I in the "OpenPCDet/pcdet/models/dense_heads/transfusion_head py" file found an error. The specific errors in lines 366-369 are as follows:

    center = torch.tensor([coor_x, coor_y], dtype=torch.float32, device=device)
    center_int = center.to(torch.int32)
    # centernet_utils.draw_gaussian_to_heatmap(heatmap[gt_labels_3d[idx]], center_int, radius)
    centernet_utils.draw_gaussian_to_heatmap(heatmap[gt_labels_3d[idx]], center_int[[1,0]], radius)

Line 369 incorrectly sets the x and y coordinate order for center_int. When the pc_range is square, this situation will not produce an error, but when it is rectangular, it will be exposed. The correct code should be line 368 of the comment, why did you comment it out and change it to line 369

The xy dimension of feature map should be aligned to center_int.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants