imgaug
imgaug copied to clipboard
AttributeError: module 'numpy.random' has no attribute 'bit_generator'
the imgaug raise AttributeError: module 'numpy.random' has no attribute 'bit_generator' ? i don't know what errors is? can you help me,thank you
That's an error introduced by numpy 1.18 that was released two days ago. They moved an interface to a different location without deprecating the old name. The problem is already fixed in master, so just install directly from github (or use numpy 1.17 for now).
@aleju Hi,I also meet this problem,and I installed imgaug from github directly, just as the follow
git clone https://github.com/aleju/imgaug cd imgaug && python setup.py install
However,the problem is still occured.
Put these lines at the top of your file:
import numpy
numpy.random.bit_generator = numpy.random._bit_generator
@aleju Hi,I also meet this problem,and I installed imgaug from github directly, just as the follow git clone https://github.com/aleju/imgaug cd imgaug && python setup.py install However,the problem is still occured.
Sounds to me like it is using for some reason an older version of the library and not actually the one from master. You could also try import imgaug.augmenters as iaa; print(iaa.Cartoon())
. That augmenter doesn't exist yet in the last pypi release, so you will probably get an error for that command too.
Try pip uninstall imgaug; pip install git+https://github.com/aleju/imgaug
-- if you initially installed via pip
and not conda
. If you installed via conda
you first have to run conda remove imgaug
.
Also make sure that there is no folder imgaug
in your current working directory that might be unintentionally imported. You can try running your script after uninstall to make sure that you get an import error for imgaug
, i.e. that it is really uninstalled.
Thank you @chitholian your method works on my code. I recommend it.
AttributeError: 'numpy.random._generator.Generator' object has no attribute 'uniformInt' I am getting this error
PLEASE how do i resolve this 'AttributeError: module 'numpy.random' has no attribute '_bit_generator' ?
I solved it by doing
import numpy
numpy.random.BitGenerator = numpy.random.bit_generator.BitGenerator
sudo pip3 --update numpy