ImportError: cannot import name 'imresize' from 'scipy.misc' with keras-vis

Ask Questions Forum: ask Machine Learning Questions to our readersCategory: TensorFlow/KerasImportError: cannot import name 'imresize' from 'scipy.misc' with keras-vis
Chris Staff asked 1 month ago

I am getting the following ImportError when using the keras-vis package:

Traceback (most recent call last):
File "", line 74, in
from tf_keras_vis.visualization import visualize_activation
File "C:\Users\chris\Anaconda3\envs\tensorflow_gpu\lib\site-packages\vis\visualization\", line 7, in
from .saliency import visualize_saliency_with_losses
File "C:\Users\chris\Anaconda3\envs\tensorflow_gpu\lib\site-packages\vis\visualization\", line 5, in
from scipy.misc import imresize
ImportError: cannot import name 'imresize' from 'scipy.misc' (C:\Users\chris\Anaconda3\envs\tensorflow_gpu\lib\site-packages\scipy\misc\

What is the cause?

1 Answers
Best Answer
Chris Staff answered 1 month ago

This is caused by the fact that imresize has been deprecated from Scipy:
The keras-vis package has simply not adapted yet. Since it last updated in April 2020, I’m not too confident that it will stay up to date with changes in TensorFlow. Haven’t made it work yet on my system. I recommend tf-keras-vis instead, which works with TensorFlow 2 based Keras.

Your Answer

10 + 1 =