From 1acb18522ac110fe38f308600c176bb814ee6d2f Mon Sep 17 00:00:00 2001 From: ucsk <53417456+ucsk@users.noreply.github.com> Date: Tue, 15 Mar 2022 20:34:38 +0800 Subject: [PATCH] [Fix] Update operators.py (#5357) Fixed a possible error on line 2021: "TypeError: 'numpy.float64' object cannot be interpreted as an integer". --- ppdet/data/transform/operators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index 0c56d0c5d..df852584a 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -2032,8 +2032,8 @@ class Pad(BaseOperator): im_h < h and im_w < w ), '(h, w) of target size should be greater than (im_h, im_w)' else: - h = np.ceil(im_h / self.size_divisor) * self.size_divisor - w = np.ceil(im_w / self.size_divisor) * self.size_divisor + h = int(np.ceil(im_h / self.size_divisor) * self.size_divisor) + w = int(np.ceil(im_w / self.size_divisor) * self.size_divisor) if h == im_h and w == im_w: return sample -- GitLab