From e274ee5762d0355e26b7f208ccd17e43297a8bb3 Mon Sep 17 00:00:00 2001 From: Aganlengzi Date: Tue, 20 Dec 2022 19:24:42 +0800 Subject: [PATCH] fix CE arange not support float16 (#7529) --- ppdet/modeling/bbox_utils.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ppdet/modeling/bbox_utils.py b/ppdet/modeling/bbox_utils.py index 0dd54b376..e2a42449d 100644 --- a/ppdet/modeling/bbox_utils.py +++ b/ppdet/modeling/bbox_utils.py @@ -343,11 +343,8 @@ def xywh2xyxy(box): def make_grid(h, w, dtype): - yv, xv = paddle.meshgrid( - [paddle.arange( - h, dtype=dtype), paddle.arange( - w, dtype=dtype)]) - return paddle.stack((xv, yv), 2) + yv, xv = paddle.meshgrid([paddle.arange(h), paddle.arange(w)]) + return paddle.stack((xv, yv), 2).cast(dtype=dtype) def decode_yolo(box, anchor, downsample_ratio): -- GitLab