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

Problem with tutorial #192

Open
tombinic opened this issue Nov 29, 2024 · 0 comments
Open

Problem with tutorial #192

tombinic opened this issue Nov 29, 2024 · 0 comments

Comments

@tombinic
Copy link

tombinic commented Nov 29, 2024

I'm trying to replicate the tutorial

`model = tf.keras.applications.vgg16.VGG16(weights="imagenet", include_top=True)

img = tf.keras.preprocessing.image.load_img(IMAGE_PATH, target_size=(224, 224))
img = tf.keras.preprocessing.image.img_to_array(img)
data = ([img], None)

explainer = GradCAM()
grid = explainer.explain(data, model, class_index=281) # 281 is the tabby cat index in ImageNet

explainer.save(grid, ".", "grad_cam.png")`

it gives me an error

"AttributeError: 'Dense' object has no attribute 'output_shape'"
How can I fix it? Thank you

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