sicara / tf-explain

Interpretability Methods for tf.keras models with Tensorflow 2.x

Home Page:https://tf-explain.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Keras-vis: 'GradCAM' is not defined

mubeenmeo344 opened this issue · comments


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.

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

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"