I have some code from my friend. He run it smoothly but I encounter
module **scipy.misc** has no attribute *imresize*
I'm searching, installed Pillow (PIL), scipy, scikit,.. but dont work
I asked my friend but he forgot what he has installed.
If you check the documentation for scipy.misc.imresize
from many recent versions of scipy
, you'll find the following line up at the top:
imresize
is deprecated!imresize
is deprecated in SciPy 1.0.0, and will be removed in 1.3.0. Use Pillow instead:numpy.array(Image.fromarray(arr).resize())
.
The 1.3.0 release happened yesterday, so if you downloaded scipy
on your system today, you may have got the new version, which won't have access to that function any longer. The documentation I quoted above suggests a code fragment (using numpy
and PIL
) that should work as an alternative.
scipy.misc.imresize is depricated.
There are two alternatives
As pointed by @Bickknght we can use PIL (Pillow)library.
from PIL import Image
numpy.array(Image.fromarray(arr).resize())
Using Skimage
from skimage.transform import resize
from skimage import data
image = data.camera()
resize(image, (100, 100))
Install scipy(1.2.2) this will work.
pip install scipy==1.2.2
If still not work --> install pillow
pip install Pillow
scipy.misc.imresize - Resize an image [requires Pillow]
OR
help('scipy.misc.imresize')
scipy.misc.imresize = imresize(*args, **kwds)
`imresize` is deprecated!
`imresize` is deprecated in SciPy 1.0.0, and will be removed in 1.3.0.
Use Pillow instead: ``numpy.array(Image.fromarray(arr).resize())``.
Resize an image.
This function is only available if Python Imaging Library (PIL) is installed.
This worked for me:
pip install scipy==1.2.2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With