From aa217a9f8a963a310ab5ee5adea56290789b845f Mon Sep 17 00:00:00 2001 From: Yang Zhang Date: Mon, 18 May 2020 10:40:01 +0800 Subject: [PATCH] Work around broadcast issue in iou_aware (#690) --- ppdet/modeling/anchor_heads/iou_aware.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ppdet/modeling/anchor_heads/iou_aware.py b/ppdet/modeling/anchor_heads/iou_aware.py index 9a2c4ee41..7a85a70a6 100644 --- a/ppdet/modeling/anchor_heads/iou_aware.py +++ b/ppdet/modeling/anchor_heads/iou_aware.py @@ -35,7 +35,9 @@ def _split_ioup(output, an_num, num_classes): def _de_sigmoid(x, eps=1e-7): x = fluid.layers.clip(x, eps, 1 / eps) - x = fluid.layers.clip((1 / x - 1.0), eps, 1 / eps) + one = fluid.layers.fill_constant( + shape=[1, 1, 1, 1], dtype=x.dtype, value=1.) + x = fluid.layers.clip((one / x - 1.0), eps, 1 / eps) x = -fluid.layers.log(x) return x -- GitLab