raghakot / keras-vis

Neural network visualization toolkit for keras
https://raghakot.github.io/keras-vis
MIT License
2.97k stars 664 forks source link

from vis.visualization import visualize_cam, overlay failing #182

Closed amitkayal closed 5 years ago

amitkayal commented 5 years ago

I am trying to import this module (from vis.visualization import visualize_cam, overlay ) from google colab and facing following error. Looks like, that the module is referring old package which is no longer available? Error: Using TensorFlow backend.

ImportError Traceback (most recent call last)

in () 1 import matplotlib.cm as cm ----> 2 from vis.visualization import visualize_cam, overlay 3 from keras import activations 1 frames /usr/local/lib/python3.6/dist-packages/vis/visualization/saliency.py in () 3 import numpy as np 4 import matplotlib.cm as cm ----> 5 from scipy.misc import imresize 6 7 from keras.layers.convolutional import _Conv ImportError: cannot import name 'imresize'
keisen commented 5 years ago

Unfortunately, scipy.misc.imresize have been removed since scipy==1.3.0 . We are going to fix this problem. But for now, I believe that you can run following to avoid it:

pip install -I scipy==1.2.*
sourcecode369 commented 4 years ago

Unfortunately, scipy.misc.imresize have been removed since scipy==1.3.0 . We are going to fix this problem. But for now, I believe that you can run following to avoid it:

pip install -I scipy==1.2.*

Thanks this really worked for me.

bersbersbers commented 4 years ago

Another fix: cherry-pick https://github.com/raghakot/keras-vis/commit/39e775b65c8fe89a86eaf3ea686db677de9990b2

git clone --branch=0.4.1 https://github.com/raghakot/keras-vis.git
cd keras-vis/
git cherry-pick 39e775
pip install .
GopinathAchuthan commented 3 years ago

After using this command, pip install -I scipy==1.2.*

I am getting a different error. 5 from scipy.misc import imresize 6 ----> 7 from keras.layers.convolutional import _Conv 8 from keras.layers.pooling import _Pooling1D, _Pooling2D, _Pooling3D 9 from keras import backend as K

ImportError: cannot import name '_Conv'

bersbersbers commented 3 years ago

@GopinathRock you are describing #228. Note that this project is no longer maintained, consider using alternatives instead.