You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Works with just about anything. The problem is that pillow newly implemented __array__, but only without arguments. Numpy requires __array__ to take an optional dtype argument. This is used e.g. by numpy.array when the user passes a dtype argument. This should be with just about any numpy/python version.
Reacted by Sebastian Berg, bersbersbers and parameciumvance
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 dtype anyway.
Pillow 8.3.1 has now been released with a fix for this.
Reacted by Sebastian Berg, Kento Nozawa, owocado, Hugo van Kemenade, Janosh Riebesell, skupr-anaconda, Mark Daoust, Adaloglou Nikolas and F-G Fernandez
Reacted by Sebastian Berg, Kento Nozawa, Hugo van Kemenade, Mark Daoust and Adaloglou Nikolas
Activity
radarhere commentedon Jul 1, 2021
What version of Python are you using? What version of numpy?
vgrabovets commentedon Jul 1, 2021
Same problem here.
Python 3.7.4
numpy 1.21.0
workaround:
t-vi commentedon Jul 1, 2021
Works with just about anything. The problem is that pillow newly implemented
__array__, but only without arguments. Numpy requires__array__to take an optional dtype argument. This is used e.g. by numpy.array when the user passes a dtype argument. This should be with just about any numpy/python version.doublex commentedon Jul 1, 2021
fails with python 3.8 + 3.9, numpy 1.20 + 1.21
t-vi commentedon Jul 1, 2021
I'll send a patch.
carmocca commentedon Jul 1, 2021
We are seeing errors in
3.{6,7,8,9}ericpre commentedon Jul 1, 2021
Same issue in https://github.com/hyperspy/hyperspy/runs/2961516889 for all python version >=3.6 using the
imageiolibrary:The python 3.6 build is with numpy 1.17.1
[-]Pillow 8.3 and numpy[/-][+]Pillow 8.3 and NumPy[/+]cgebbe commentedon Jul 1, 2021
same here: windows, python=3.6.8, numpy=1.19.5, Pillow=8.3.0
seberg commentedon Jul 1, 2021
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
dtypeanyway.workaround PIL upstream issue
Backout pillow=8.3.0 due to a crash
IceTDrinker commentedon Jul 5, 2021
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)
janosh commentedon Jul 6, 2021
Definitely needs a hot fix. This is all over the place.
hugovk commentedon Jul 6, 2021
There'll be an 8.3.1 soon, keep an eye on #5578. Thank you for your patience!
radarhere commentedon Jul 7, 2021
Pillow 8.3.1 has now been released with a fix for this.