magenta / magenta-demos

Demonstrations of Magenta Models
Apache License 2.0
1.32k stars 419 forks source link

Image Stylization notebook doesn't work on Colab #78

Open sebamacchia opened 5 years ago

sebamacchia commented 5 years ago

getting this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-3b16e573062a> in <module>()
     47 DownloadCheckpointFiles()
     48 image = np.expand_dims(image_utils.load_np_image(
---> 49           os.path.expanduser(input_image)), 0)
     50 if demo == 'monet':
     51     checkpoint = 'checkpoints/multistyle-pastiche-generator-monet.ckpt'

1 frames
/usr/local/lib/python3.6/dist-packages/magenta/models/image_stylization/image_utils.py in load_np_image_uint8(image_file)
    407     f.write(tf.gfile.GFile(image_file, 'rb').read())
    408     f.flush()
--> 409     image = scipy.misc.imread(f.name)
    410     # Workaround for black-and-white images
    411     if image.ndim == 2:

AttributeError: module 'scipy.misc' has no attribute 'imread'
rgb91 commented 4 years ago

I got around this error by downgrading scipy to 1.1.0:

pip install scipy==1.1.0