'tuple' object has no attribute 'cpu'

Author: sumit-iitp-2111Created Feb 9, 2023Updated Apr 9, 2025

when I try to execute grayscale_cam = cam(tensor)[0, :,:] in the tutorial for yolov5, I get this error. Please help, I am using the same code for yolov7

Source: jacobgil/pytorch-grad-cam