You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use GradCam on my model that takes more than one input arguments. I tried to pass *input_tensor instead of input_tensor since I have a list of 4 arguments. I was trying to modify the source code accordingly. I am facing a series of errors. I am at this point now:
Traceback (most recent call last):
File "/home/ishita-wicon/Documents/QA/ISIQA/UNET/expl_exp.py", line 449, in
grayscale_cam = cam(input_tensor=[left_patches, right_patches, left_image_patches, right_image_patches], targets=targets)
File "/home/ishita-wicon/.local/lib/python3.10/site-packages/pytorch_grad_cam/base_cam.py", line 192, in call
return self.forward(input_tensor,
File "/home/ishita-wicon/.local/lib/python3.10/site-packages/pytorch_grad_cam/base_cam.py", line 105, in forward
cam_per_layer = self.compute_cam_per_layer(*input_tensor, #changes to * for list
TypeError: BaseCAM.compute_cam_per_layer() takes 4 positional arguments but 7 were given
Is there any other way?
The text was updated successfully, but these errors were encountered:
I am trying to use GradCam on my model that takes more than one input arguments. I tried to pass *input_tensor instead of input_tensor since I have a list of 4 arguments. I was trying to modify the source code accordingly. I am facing a series of errors. I am at this point now:
Traceback (most recent call last):
File "/home/ishita-wicon/Documents/QA/ISIQA/UNET/expl_exp.py", line 449, in
grayscale_cam = cam(input_tensor=[left_patches, right_patches, left_image_patches, right_image_patches], targets=targets)
File "/home/ishita-wicon/.local/lib/python3.10/site-packages/pytorch_grad_cam/base_cam.py", line 192, in call
return self.forward(input_tensor,
File "/home/ishita-wicon/.local/lib/python3.10/site-packages/pytorch_grad_cam/base_cam.py", line 105, in forward
cam_per_layer = self.compute_cam_per_layer(*input_tensor, #changes to * for list
TypeError: BaseCAM.compute_cam_per_layer() takes 4 positional arguments but 7 were given
Is there any other way?
The text was updated successfully, but these errors were encountered: