aleju / imgaug

Image augmentation for machine learning experiments.
http://imgaug.readthedocs.io
MIT License
14.42k stars 2.44k forks source link

numpy 1.20 bool deprecation #829

Open marcown opened 1 year ago

marcown commented 1 year ago

Hi,

I get the following error:

  File "/home/markus/.local/lib/python3.10/site-packages/imgaug/augmenters/meta.py", line 3368, in _get_augmenter_active
    augmenter_active = np.zeros((nb_rows, len(self)), dtype=np.bool)
  File "/home/markus/.local/lib/python3.10/site-packages/numpy/__init__.py", line 305, in __getattr__
    raise AttributeError(__former_attrs__[attr])

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

Any plan to fix this, or am I missing something?

marcown commented 1 year ago

if you have the same problem:

Fixed fork

MalteEbner commented 5 months ago

I have the same problem and the fix works for me as well :)

Yaser-wyx commented 4 weeks ago

A quick solusion for me is set np.bool=bool before import imgaug.