From 9d942c50663d47173eb78b4450ce6779e9aeb243 Mon Sep 17 00:00:00 2001 From: Guanghua Yu <742925032@qq.com> Date: Thu, 10 Jun 2021 13:19:23 +0800 Subject: [PATCH] fix np.int warning in operator (#3344) --- ppdet/data/transform/operators.py | 4 ++-- static/ppdet/data/transform/operators.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ppdet/data/transform/operators.py b/ppdet/data/transform/operators.py index b37603f87..54f918c9b 100644 --- a/ppdet/data/transform/operators.py +++ b/ppdet/data/transform/operators.py @@ -1506,8 +1506,8 @@ class Cutmix(BaseOperator): w = max(img1.shape[1], img2.shape[1]) cut_rat = np.sqrt(1. - factor) - cut_w = np.int(w * cut_rat) - cut_h = np.int(h * cut_rat) + cut_w = np.int32(w * cut_rat) + cut_h = np.int32(h * cut_rat) # uniform cx = np.random.randint(w) diff --git a/static/ppdet/data/transform/operators.py b/static/ppdet/data/transform/operators.py index 78ae281e9..d51e68d17 100644 --- a/static/ppdet/data/transform/operators.py +++ b/static/ppdet/data/transform/operators.py @@ -1343,8 +1343,8 @@ class CutmixImage(BaseOperator): w = max(img1.shape[1], img2.shape[1]) cut_rat = np.sqrt(1. - factor) - cut_w = np.int(w * cut_rat) - cut_h = np.int(h * cut_rat) + cut_w = np.int32(w * cut_rat) + cut_h = np.int32(h * cut_rat) # uniform cx = np.random.randint(w) -- GitLab