Skip to content

Certain images will report exception when generating greyscale_cam #4

@tvc5586

Description

@tvc5586

Hello.

I encountered a issue with the generation of greyscale_cam (located in core.py). In short, some images will report exception "'int' object has no attribute 'backward'", while others won't. I found out that the problem is caused by the line that generates greyscale_cam.

The line originally looks like grayscale_cam = self.method(tensor, [self.target])
Even after changing the line to grayscale_cam = self.method(tensor.requires_grad_(), [self.target]) the problem still persists.

For records, I am using YOLOv8n.pt downloaded from Ultralytics and ISIC2019 dataset. The exception occurs when I try to use any method but "EigenCAM".

Hopefully a solution can be found as soon as possible.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions