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

This error comes with tensorflow 2.x #16

Open
AnushangaWimalasena opened this issue Aug 18, 2021 · 2 comments
Open

This error comes with tensorflow 2.x #16

AnushangaWimalasena opened this issue Aug 18, 2021 · 2 comments

Comments

@AnushangaWimalasena
Copy link

AttributeError                            Traceback (most recent call last)
<ipython-input-21-73a1b345b022> in <module>()
----> 1 ig = integrated_gradients(model)

/content/IntegratedGradients/IntegratedGradients.py in __init__(self, model, outchannels, verbose)
     33         #load model supports keras.Model and keras.Sequential
     34         if isinstance(model, Sequential):
---> 35             self.model = model.model
     36         elif isinstance(model, Model):
     37             self.model = model

AttributeError: 'Sequential' object has no attribute 'model'
@KaranamLokesh
Copy link

Hi, were you able to resolve this issue?

@jerabaul29
Copy link

Looks like this is written for a very old version of tensorflow and keras, and this code has stopped working with currently distributed versions of tensorflow and keras for a long time :( . See https://keras.io/examples/vision/integrated_gradients/ for a possible alternative / source of inspiration, though there is not a clear api etc (see for example the comment on this example at keras-team/keras-io#1226 ).

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

3 participants