From 7b2c0ef104aecf22ed5c33ad90e85ff4ec74bffc Mon Sep 17 00:00:00 2001 From: h-bo Date: Tue, 25 Jul 2023 15:03:15 +0800 Subject: [PATCH] Update rtdetr_transformer.py [w, h] is mis-written to [h, w] which makes anchors error --- rtdetr_paddle/ppdet/modeling/transformers/rtdetr_transformer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtdetr_paddle/ppdet/modeling/transformers/rtdetr_transformer.py b/rtdetr_paddle/ppdet/modeling/transformers/rtdetr_transformer.py index 2fe64739..3eccdecb 100644 --- a/rtdetr_paddle/ppdet/modeling/transformers/rtdetr_transformer.py +++ b/rtdetr_paddle/ppdet/modeling/transformers/rtdetr_transformer.py @@ -462,7 +462,7 @@ def _generate_anchors(self, end=w, dtype=dtype)) grid_xy = paddle.stack([grid_x, grid_y], -1) - valid_WH = paddle.to_tensor([h, w]).astype(dtype) + valid_WH = paddle.to_tensor([w, h]).astype(dtype) grid_xy = (grid_xy.unsqueeze(0) + 0.5) / valid_WH wh = paddle.ones_like(grid_xy) * grid_size * (2.0**lvl) anchors.append(