jwyang / graph-rcnn.pytorch

[ECCV 2018] Official code for "Graph R-CNN for Scene Graph Generation"
733 stars 157 forks source link

BUG? ground truth BoxList initialization error when using it for relation prediction? #102

Open shizi626 opened 4 years ago

shizi626 commented 4 years ago

When using relation heads (lib\scene_parser\rcnn\modeling\relation_heads\relation_heads.py) to predict relations with ground truth bounding box in training phrase, I got a weird error in here

  File "/home/graph-rcnn.pytorch-master/lib/scene_parser/rcnn/structures/boxlist_ops.py", line 123, in cat_boxlist
    assert all(set(bbox.fields()) == fields for bbox in bboxes)
AssertionError

After some survey, I found the reason is that the fields in proposals and proposals_gt is different after Line 144 proposals_gt = self.box_post_processor((class_logits, box_regression), targets_cp, skip_nms=True) in relation_heads.py.

(Pdb) proposals_gt[0].fields()
['scores', 'logits', 'features', 'labels', 'regression_targets']
(Pdb) proposals[0].fields()
['objectness', 'labels', 'regression_targets', 'features', 'logits']

The proposals_gt is expected to be initialized the same as proposals in PostProcessor in lib\scene_parser\rcnn\modeling\roi_heads\box_head\inference.py, however, Line 110 add one field named scores rather than objectness. Is this a bug? Or do I misunderstand the usage?