From 52278eabde62349de4fdd712c5d6d76aaabd42ff Mon Sep 17 00:00:00 2001 From: Yu Chen <71476156+ChenYu-K@users.noreply.github.com> Date: Mon, 19 Jun 2023 12:43:44 +0900 Subject: [PATCH] =?UTF-8?q?Fix=20alias=20error=20due=20to=20numpy=20update?= =?UTF-8?q?=EF=BC=88meta.py=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations It says: `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use bool by itself. Doing this will not modify any behavior and is safe. If specifically wanted the numpy scalar type, use `np.bool_` here. AttributeError: module 'numpy' has no attribute 'bool'. `np.bool` was a deprecated alias for the builtin `bool`. To avoid this error in existing code, use `bool` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.bool_` here. The aliases was originally deprecated in NumPy 1.20; for more details and guidance see the original release note at: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations --- imgaug/augmenters/meta.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgaug/augmenters/meta.py b/imgaug/augmenters/meta.py index 9279a0a4d..1de256e8e 100644 --- a/imgaug/augmenters/meta.py +++ b/imgaug/augmenters/meta.py @@ -3384,7 +3384,7 @@ def _get_augmenter_active(self, nb_rows, random_state): # pylint: disable=invalid-name nn = self._get_n(nb_rows, random_state) nn = [min(n, len(self)) for n in nn] - augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool) + augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool_) for row_idx, n_true in enumerate(nn): if n_true > 0: augmenter_active[row_idx, 0:n_true] = 1