Closed zhenyu-brice-zhao closed 2 years ago
run separately on pytorch version 1.11.1 and 1.8.1, I got the same error
Hi, Can you please upgrade the pytorch-grad-cam version ? Which version are you using ?
Thank you, I use pip install grad-cam to get your code without checking the version.
Can you please do pip install grad-cam --upgrade And check if you still have this problem ?
I tryed to upgrade but I got the same error.
I think now the version is 1.3.7. Is it the latest version?
Hi, It's 1.3.9, I just pushed a new version, Please try again and let me know, I think it should be solved now. pip install grad-cam --upgrade
It's ok now. Thank you!
Hello, I have tryed your tutorial EigenCAM for yolo5 but I got an error below
RuntimeError: element 0 of tensors does not require grad and does not have a grad_fn
pointing to linegrayscale_cam = cam(tensor)[0, :, :]
and inner line 82 in file base_cam.py:loss.backward(retain_graph=True)
I'm not sure why this error occured because I just run your code without any modification. It seems that some tensors are not required grad, so it can not go backward. Any help would be greatly appreciated.