Import Error: 'scipy.misc import imsave' on Google Colaboratory

Viewed 19553

Not able to use scipy.misc.imsave on Colaboratory

from scipy.misc import imsave

ImportError: cannot import name 'imsave'

Tried to install Pillow and Scipy again on Colab, but the requirements are already satisfied, so Colab does not install these packages

3 Answers

From documentation here, imsave is deprecated. You can use imageio.imwrite instead.

In case you really need it, you can install an older scipy version.

!pip install -U scipy==1.2.0

Use

from keras.preprocessing.image import save_img

Instead of

from scipy.misc import imsave

imsave is deprecated! imsave is deprecated in SciPy 1.0.0, and will be removed in 1.2.0. Use imageio.imwrite instead.

this is detail.

Related