pytorch-grad-cam
pytorch-grad-cam copied to clipboard
Problem EigenCAM for YOLO5
Hi there! Hello everyone! I am trying to use grad-cam with Yolov5. I've done some experimenting and if I run the notebook using the default code found at https://jacobgil.github.io/pytorch-gradcam-book/EigenCAM%20for%20YOLO5.html everything works. The problem comes when I try to load a yolov5 custum model and with custom weights, basically if I run these 2 instructions:
cam = EigenCAM(model, target_layers, use_cuda=False) grayscale_cam = cam(tensor)[0, :, :]
the python interpreter tells me AttributeError: 'tuple' object has no attribute 'cpu'
Someone can help me?
I got the same problem. Have you fix this ?
I also encountered this problem. Do you find a solution or alternative?
I have found a solution to this problem. We have to modify the pytorch_grad_cam original scripts.