We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Model: Alexnet Dataset: CIFAR-10
The code works well with layer_name='features' but I get this error when I change it to layer_name='classifier'
layer_name='features'
layer_name='classifier'
Code:
# GRADCAM++ image_path = 'xyz' image = load_image(image_path) norm_image = apply_transforms(image, size=32) model_dict = dict(arch=model, layer_name='classifier_0', input_size=(32, 32)) gradcampp = GradCAMpp(model_dict) output = gradcampp(norm_image) visualize(norm_image, output)
Error:
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-63-fed255ab9edc> in <module>() 7 8 gradcampp = GradCAMpp(model_dict) ----> 9 output = gradcampp(norm_image) 10 visualize(norm_image, output) 1 frames <ipython-input-46-e7d860e12ca6> in __call__(self, input_, class_idx, retain_graph) 70 71 def __call__(self, input_, class_idx=None, retain_graph=False): ---> 72 return self.forward(input_, class_idx, retain_graph) <ipython-input-49-d221b5d1444c> in forward(self, input_image, class_idx, retain_graph) 32 gradients = self.gradients['value'] 33 activations = self.activations['value'] ---> 34 b, k, u, v = gradients.size() 35 36 alpha_num = gradients.pow(2) ValueError: not enough values to unpack (expected 4, got 2)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Model: Alexnet
Dataset: CIFAR-10
The code works well with
layer_name='features'
but I get this error when I change it tolayer_name='classifier'
Code:
Error:
The text was updated successfully, but these errors were encountered: