"vscode:/vscode.git/clone" did not exist on "465cdb842513eb910aa20fcedea1d2edd15dc7b7"
Commit f7843c44 authored by A. Unique TensorFlower's avatar A. Unique TensorFlower
Browse files

Internal change

PiperOrigin-RevId: 300222585
parent 08f45dc4
...@@ -465,7 +465,9 @@ class RetinanetBoxLoss(object): ...@@ -465,7 +465,9 @@ class RetinanetBoxLoss(object):
# for instances, the regression targets of 512x512 input with 6 anchors on # for instances, the regression targets of 512x512 input with 6 anchors on
# P3-P7 pyramid is about [0.1, 0.1, 0.2, 0.2]. # P3-P7 pyramid is about [0.1, 0.1, 0.2, 0.2].
normalizer = num_positives * 4.0 normalizer = num_positives * 4.0
mask = tf.not_equal(box_targets, 0.0) mask = tf.cast(tf.not_equal(box_targets, 0.0), dtype=tf.float32)
box_targets = tf.expand_dims(box_targets, axis=-1)
box_outputs = tf.expand_dims(box_outputs, axis=-1)
box_loss = self._huber_loss(box_targets, box_outputs, sample_weight=mask) box_loss = self._huber_loss(box_targets, box_outputs, sample_weight=mask)
box_loss /= normalizer box_loss /= normalizer
return box_loss return box_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