This error comes with tensorflow 2.x
AnushangaWimalasena opened this issue · 2 comments
AnushangaWimalasena commented
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 commented
Hi, were you able to resolve this issue?
jerabaul29 commented
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 ).