aleju / imgaug

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

imgaug.random conflict with numpy.random #751

Closed Blink621 closed 3 years ago

Blink621 commented 3 years ago

Hello, I tried to use imgaug with python 3.6.7 on Ubuntu 16.04. After I use pip to install imgaug and try to import it in ipython. It raised an error called module 'numpy' has no attribute 'random' as follows.

image

I guess the reason is that the imgaug library has a 'random.py' and when python tried to find the 'random.py' that belongs to numpy, the conflict appears. After I rename the 'random.py' file under the 'imgaug' folder, the error disappears and it can be successfully imported. Nevertheless, when I tried to import sub folder like 'import imgaug.augmenters', it raised an error called ModuleNotFoundError: No module named 'imgaug.augmenters': 'imgaug' is not a package. Actually, when I print imgaug now it point to imgaug.py not init.py.

image

I really hope someone can help me! Thank you!

Blink621 commented 3 years ago

My problem solved when my administrator changed the environment from miniconda3 to anaconda3 and upgrade python version to 3.8.5.