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

yolox_head_fast.py中当G == 0的返回loss有问题 #22

Open
xiaoxuebajie opened this issue Jan 8, 2023 · 0 comments
Open

yolox_head_fast.py中当G == 0的返回loss有问题 #22

xiaoxuebajie opened this issue Jan 8, 2023 · 0 comments

Comments

@xiaoxuebajie
Copy link

if G == 0: # 所有图片都没有gt时 obj_targets = torch.zeros((N, A, 1), dtype=torch.float32, device=obj_preds.device) num_fg = 1 # 所有图片都没有gt时,设为1 loss_obj = self.bcewithlog_loss(obj_preds, obj_targets) loss_obj = loss_obj.sum() / num_fg losses = { "loss_obj": loss_obj, } return losses
yolox_head_fast.py中的这一段是不是错了
这个losses和下面的对不上
return ( loss, reg_weight * loss_iou, loss_obj, loss_cls, loss_l1, num_fg / max(num_gts, 1), )

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