"git@developer.sourcefind.cn:modelzoo/resnet50_tensorflow.git" did not exist on "90b8e658f223936e23ab44c99daabb4030e005c9"
Commit 067d35f9 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 344465468
parent ff5b647a
...@@ -330,7 +330,6 @@ class OlnRpnIoULoss(object): ...@@ -330,7 +330,6 @@ class OlnRpnIoULoss(object):
(gt_left + gt_right) * (gt_top + gt_bottom) - (gt_left + gt_right) * (gt_top + gt_bottom) -
inter_area) inter_area)
iou = inter_area / (union_area + 1e-8) iou = inter_area / (union_area + 1e-8)
iou = tf.where(mask, iou, tf.ones_like(iou))
mask_ = tf.cast(mask, tf.float32) mask_ = tf.cast(mask, tf.float32)
iou = tf.clip_by_value(iou, clip_value_min=1e-8, clip_value_max=1.0) iou = tf.clip_by_value(iou, clip_value_min=1e-8, clip_value_max=1.0)
neg_log_iou = -tf.math.log(iou) neg_log_iou = -tf.math.log(iou)
...@@ -498,7 +497,7 @@ class OlnBoxScoreLoss(object): ...@@ -498,7 +497,7 @@ class OlnBoxScoreLoss(object):
mask = tf.cast(mask, dtype=tf.float32) mask = tf.cast(mask, dtype=tf.float32)
score_loss = self._l1_loss(score_targets, score_outputs, score_loss = self._l1_loss(score_targets, score_outputs,
sample_weight=mask) sample_weight=mask)
score_loss /= num_valid score_loss /= (num_valid + 1e-10)
return score_loss return score_loss
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment