Skip to content

Gradient is of type None #102

@JulesScholler

Description

@JulesScholler

I'm trying to un GradCAM on my own model (modified VGG16 with input shape (1,100,100,3) and 5 classes).

When I try to run :

`# Instantiation of the explainer
explainer = GradCAM()

Call to explain() method

output = explainer.explain(validation_data, model, 'block5_conv3', 2)`

Then in the function get_gradients_and_filters(model, images, layer_name, class_index):

grads = tape.gradient(loss, conv_outputs)

grads is 'NoneType' so it cannot continue.

I'm not sure why I get this error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions