Skip to content

Code bugs in calculating lossess? #21

@zachpvin

Description

@zachpvin

I noticed that there are mismatched keys name in weight_dict, effectively making the losses calculation skipped loss_segments and loss_actionness in this line:

TadTR/engine.py

Lines 45 to 46 in 3af0abc

losses = sum(loss_dict[k] * weight_dict[k]
for k in loss_dict.keys() if k in weight_dict)

Looking at the weight_dict, loss_seg is used rather than loss_segments

TadTR/models/tadtr.py

Lines 498 to 501 in 3af0abc

weight_dict = {
'loss_ce': args.cls_loss_coef,
'loss_seg': args.seg_loss_coef,
'loss_iou': args.iou_loss_coef}

losses['loss_segments'] = loss_segment.sum() / num_segments

For actionness, it's assigned as loss_iou instead of loss_actionness, which replaced the loss_iou by segments loss.

losses['loss_iou'] = loss_actionness

Are these bugs? Could you confirm it? Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions