From 97e9e75bd1c746084d8f047cfd7abf8cc64c9263 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Fri, 22 Apr 2022 19:40:36 +0800 Subject: [PATCH] fix transform resize type to float32 (#5802) --- ppdet/data/transform/operators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index ba08c351e..01890a84d 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -824,7 +824,7 @@ class Resize(BaseOperator): im_scale_x = resize_w / im_shape[1] im = self.apply_image(sample['image'], [im_scale_x, im_scale_y]) - sample['image'] = im + sample['image'] = im.astype(np.float32) sample['im_shape'] = np.asarray([resize_h, resize_w], dtype=np.float32) if 'scale_factor' in sample: scale_factor = sample['scale_factor'] -- GitLab