raghakot / keras-vis

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

cannot import 'imresize' #203

Closed abeepathak96 closed 4 years ago

abeepathak96 commented 4 years ago
abeepathak96 commented 4 years ago

ImportError Traceback (most recent call last)

in () ----> 1 from vis.visualization import visualize_activation 2 from vis.utils import utils 3 from keras import activations 4 5 from matplotlib import pyplot as plt 1 frames /usr/local/lib/python3.6/dist-packages/vis/visualization/__init__.py in () 5 from .activation_maximization import visualize_activation 6 ----> 7 from .saliency import visualize_saliency_with_losses 8 from .saliency import visualize_saliency 9 from .saliency import visualize_cam_with_losses /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'
jwmandeville commented 4 years ago

I had the same problem. I solved it by installing scipy 1.1.0. The version I had from pip was 1.3.0.

pip install scipy==1.1.0

keisen commented 4 years ago

Thanks @jwmandeville for reporting the solution. And the api that caused ImportError was not used in keras-vis now.

We'll close this issue but if you find other problems corresponding this issue, feel free to reopen.

kwende commented 4 years ago

@keisen , I don't understand your comment:

"And the api that caused ImportError was not used in keras-vis now."

I just installed keras-vis via pip and got this error going through the samples. Is it not supposed to happen anymore, or is the official solution what @jwmandeville found?

keisen commented 4 years ago

Hi, @kwende . Sorry for being unclear. Now, keras-vis on PiPY has a problem that is no longer updated, so please install and use keras-vis on github.

pip install -U -I git+https://github.com/raghakot/keras-vis.git