From ae01a8227ae1ea156cb70f1d585dab2f06630558 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 9 Jan 2019 11:31:59 +0100 Subject: [PATCH 1/2] * fix for the problem of incompatabile shapes --- luminoth/models/fasterrcnn/rcnn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/luminoth/models/fasterrcnn/rcnn.py b/luminoth/models/fasterrcnn/rcnn.py index e70910eb..afa483e7 100644 --- a/luminoth/models/fasterrcnn/rcnn.py +++ b/luminoth/models/fasterrcnn/rcnn.py @@ -383,11 +383,15 @@ def loss(self, prediction_dict): bbox_offset_cleaned = tf.boolean_mask( bbox_flatten, cls_flatten, 'bbox_offset_cleaned') + bbox_offsets_target_labeled_cleaned = tf.boolean_mask( + bbox_offsets_target_labeled, cls_flatten, 'bbox_offsets_target_labeled_cleaned' + ) + # Calculate the smooth l1 loss between the "cleaned" bboxes # offsets (that means, the useful results) and the labeled # targets. reg_loss_per_proposal = smooth_l1_loss( - bbox_offset_cleaned, bbox_offsets_target_labeled, + bbox_offset_cleaned, bbox_offsets_target_labeled_cleaned, sigma=self._l1_sigma ) From b2d776b7b49a6bcd0d72b4157d98d410808d9f48 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 24 Jan 2019 09:11:36 +0100 Subject: [PATCH 2/2] * adjust to code style --- luminoth/models/fasterrcnn/rcnn.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/luminoth/models/fasterrcnn/rcnn.py b/luminoth/models/fasterrcnn/rcnn.py index afa483e7..e96fd0e2 100644 --- a/luminoth/models/fasterrcnn/rcnn.py +++ b/luminoth/models/fasterrcnn/rcnn.py @@ -384,7 +384,8 @@ def loss(self, prediction_dict): bbox_flatten, cls_flatten, 'bbox_offset_cleaned') bbox_offsets_target_labeled_cleaned = tf.boolean_mask( - bbox_offsets_target_labeled, cls_flatten, 'bbox_offsets_target_labeled_cleaned' + bbox_offsets_target_labeled, cls_flatten, + 'bbox_offsets_target_labeled_cleaned' ) # Calculate the smooth l1 loss between the "cleaned" bboxes