Git Product home page Git Product logo

Comments (9)

hequn avatar hequn commented on June 1, 2024

I got the same problem and haven't solved it yet (¦3」∠)

from keras-grad-cam.

hequn avatar hequn commented on June 1, 2024

I did solve my error for the case that i did not choose the right layer output as the target.

from keras-grad-cam.

janphhe avatar janphhe commented on June 1, 2024

What layer did you take? Or what is the correct layer?

from keras-grad-cam.

hequn avatar hequn commented on June 1, 2024

@janphhe In my project, I used Xception. The target layer will be the global_avg_pooling layer, we should get a vector which seemed to be flattened. The grad visualization was made on it.

from keras-grad-cam.

surfaniac avatar surfaniac commented on June 1, 2024

Somebody has a solution for this. I get the same issue with a VGG19 network :/ I appreciate every help! Thanks a lot!

from keras-grad-cam.

Ada-Nick avatar Ada-Nick commented on June 1, 2024

I'm having the same problem, i'm sure I have selected the correct conv layer as it works for some images and not others. I'm not using a pre-trained model.

EDIT: Change to using Leaky-relu activations to prevent the vanishing gradient problem has solved it for me, all though this probably isn't easy with pre-trained networks

from keras-grad-cam.

andreimargeloiu avatar andreimargeloiu commented on June 1, 2024

@Ada-Nick, can you please give more details about your solution/intuition?

from keras-grad-cam.

Ada-Nick avatar Ada-Nick commented on June 1, 2024

@margiki Leaky-relu allows the gradient of negative values to be non-zero, preventing pooled_grads from being a null-matrix

from keras-grad-cam.

andreimargeloiu avatar andreimargeloiu commented on June 1, 2024

In my case, using LeakyReLU didn't solve the issue.

I delved deeper and found that the gradients computed by GradCAM were actually negative. Then, GradCAM applies a ReLU and the result was an empty map.

from keras-grad-cam.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.