Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 445
Ali Khan Avatar asked Jun 06 '19 21:06

Ali Khan


2 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
like image 51
korakot Avatar answered Sep 18 '22 11:09

korakot


Use

from keras.preprocessing.image import save_img

Instead of

from scipy.misc import imsave
like image 27
Bijoy Pal Avatar answered Sep 17 '22 11:09

Bijoy Pal