Replies: 2 comments
-
I fused multiple inputs into one, but still reported this error File "/workspace/128_MoreLoss_0531/main.py", line 572, in train
with SmoothGradCAMpp(G_G, input_shape=[3, 128, 128]) as cam_extractor:
File "/opt/conda/lib/python3.8/site-packages/torchcam/methods/gradient.py", line 239, in __init__
super().__init__(model, target_layer, input_shape, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/torchcam/methods/gradient.py", line 34, in __init__
super().__init__(model, target_layer, input_shape, **kwargs)
File "/opt/conda/lib/python3.8/site-packages/torchcam/methods/core.py", line 53, in __init__
target_name = locate_candidate_layer(model, input_shape)
File "/opt/conda/lib/python3.8/site-packages/torchcam/methods/_utils.py", line 43, in locate_candidate_layer
_ = mod(torch.zeros((1, *input_shape), device=next(mod.parameters()).data.device))
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1071, in _call_impl
result = forward_call(*input, **kwargs)
File "/workspace/128_MoreLoss_0531/model.py", line 783, in forward
vggm_img = self.model_mirror(vgg_img)
File "/opt/conda/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1076, in _call_impl
hook_result = hook(self, input, result)
File "/opt/conda/lib/python3.8/site-packages/torchcam/methods/_utils.py", line 34, in _record_output_shape
output_shapes.append((name, output.shape))
AttributeError: 'list' object has no attribute 'shape' |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @sususama 👋 Thanks for reporting this but without a runnable snippet I cannot reproduce that bug and really help you (I can only try to guess). Would you mind sharing a minimal snippet to reproduce this? Now circling back to my guess, you have a custom architecture that takes things that aren't tensors as input. I suggest checking that thread #210 Let me know if that helps! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
As described in the title, my network is a generative network with two inputs. When I run SmoothGradCAMpp, it will report an error and missing another necessary parameter.
Beta Was this translation helpful? Give feedback.
All reactions