sicara / tf-explain

Interpretability Methods for tf.keras models with Tensorflow 2.x
https://tf-explain.readthedocs.io
MIT License
1.02k stars 112 forks source link

Keras-vis: 'GradCAM' is not defined #152

Closed mubeenmeo344 closed 3 years ago

mubeenmeo344 commented 3 years ago

NameError Traceback (most recent call last)

in () 9 10 # Start explainer ---> 11 explainer = GradCAM() 12 grid = explainer.explain(data, model, class_index=281) # 281 is the tabby cat index in ImageNet 13 NameError: name 'GradCAM' is not defined Where is this (GradCAM()) method or class exists, why it's giving error.
RaphaelMeudec commented 3 years ago

Can you provide the full code to reproduce the error? In particular, the import lines. Thanks

mubeenmeo344 commented 3 years ago

I have solved this problem by importing class GRADCAM() from this file: "https://github.com/sicara/tf-explain/blob/master/tf_explain/core/grad_cam.py"