-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pillow 8.3 and NumPy #5571
Comments
What version of Python are you using? What version of numpy? |
Same problem here. workaround: with PIL.Image.open(filepath) as img:
numpy.array(img).astype(np.float32) |
Works with just about anything. The problem is that pillow newly implemented |
fails with python 3.8 + 3.9, numpy 1.20 + 1.21 |
I'll send a patch. |
We are seeing errors in |
Same issue in https://github.com/hyperspy/hyperspy/runs/2961516889 for all python version >=3.6 using the # Apply palette
> frame_paletted = np.array(im, np.uint8)
E TypeError: __array__() takes 1 positional argument but 2 were given
/opt/hostedtoolcache/Python/3.9.5/x64/lib/python3.9/site-packages/imageio/plugins/pillow.py:745: TypeError The python 3.6 build is with numpy 1.17.1 |
same here: windows, python=3.6.8, numpy=1.19.5, Pillow=8.3.0 |
Just to note, there is a small chance that some details changed in NumPy 1.19.x, but I doubt it matters. NumPy itself actually does not care whether you do return the correct dtype here, it is more of a hint at the moment. But, it is probably good habit to just return the requested |
Any chance of a hotfix release ? Edit : Every torchvision user using the ToTensor transform (i.e. all the vision people) will encounter the issue (and their build systems) |
Definitely needs a hot fix. This is all over the place. |
There'll be an 8.3.1 soon, keep an eye on #5578. Thank you for your patience! |
Pillow 8.3.1 has now been released with a fix for this. |
Throws exception with Pillow 8.3:
TypeError: __array__() takes 1 positional argument but 2 were given
The text was updated successfully, but these errors were encountered: