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

Not sure how to apply this to 3d Convolutions. #79

Open
Dekermanjian opened this issue Oct 25, 2021 · 0 comments
Open

Not sure how to apply this to 3d Convolutions. #79

Dekermanjian opened this issue Oct 25, 2021 · 0 comments

Comments

@Dekermanjian
Copy link

Hi, first I would like to say I am very new to using your software please forgive me if this is very obvious.

I have a model with two outputs:
Screen Shot 2021-10-25 at 5 17 32 PM

I pull the layers and the 1 output I am interested in:

# Convolutional layers indices
ixs = [10]
# Create outputs of each convolutional layer
outputs = [dcec.model.layers[i].output for i in ixs]
# define model
model_grad = Model(inputs=dcec.model.inputs, outputs=outputs)

resulting in:
Screen Shot 2021-10-25 at 5 19 53 PM

I create the grad cam object:

# Create GradCAM++ object
gradcam = GradcamPlusPlus(model_grad,
                          model_modifier=ReplaceToLinear(),
                          clone=True)

Then I try to get the cam:

cam = gradcam(CategoricalScore([0,1,2,3,4]),
              tf.expand_dims(x[1], axis=3))

but this results in an InvalidArgumentError:

InvalidArgumentError: slice index 1 of dimension 0 out of bounds. [Op:StridedSlice] name: strided_slice/

I am not sure what the error is trying to indicate. Any help will be greatly appreciated, 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