Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to Tensorflow 2 #217

Open
rortegagit opened this issue Apr 8, 2020 · 0 comments
Open

Migrate to Tensorflow 2 #217

rortegagit opened this issue Apr 8, 2020 · 0 comments

Comments

@rortegagit
Copy link

Hi, I'm using keras-vis in a jupyter notebook. Google Colab has migrated to Tensorflow 2, which provokes compatibility problems when I try to run the cells that use this library (in my case, it detects as None the penultimate layer of the model when I use the visualize_cam function)

Unable to determine penultimate ConvorPooling layer for layer_idx: -1

I think this problem may be solved by changing the imports of keras to tensorflow.keras

from tensorflow.keras.layers.convolutional import _Conv from tensorflow.keras.layers.pooling import _Pooling1D, _Pooling2D, _Pooling3D from tensorflow.keras.layers.wrappers import Wrapper from tensorflow.keras import backend as K

I'm not sure if this could harm the rest of the code, but it is the only way to maintain this library running in Google Colab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant