frgfm/torch-cam

ScoreCAM, SSCAM,ISCAM failed when feeding this image

ChordXy opened this issue ยท 2 comments

Bug description

When trying the example with torchcam v0.3.2dev0, the command is
python scripts/cam_example.py --arch resnet18 --class-idx 386 --img ./elephant.jpg --method ScoreCAM
The ScoreCAM seems to crash with no outputs.

elephant

By the way, when trying this command, it shows "WARNING:root:no value was provided for 'target_layer', thus set to 'layer4'"

Code snippet to reproduce the bug

python scripts/cam_example.py --arch resnet18 --class-idx 386 --img ./elephant.jpg --method ScoreCAM

Error traceback

2

Environment

torchcam v0.3.2dev0

frgfm commented

Hi @ChordXy ๐Ÿ‘‹

Thanks for reporting this! Two thoughts / questions:

  • if you got the visualisation, I doubt it has crashed. But it's possible that for this class index, the activation is almost uniform (and very very low). This could be possible if you passed a wrong class index
  • you closed the issue so I assume you found the source of the problem. would you mind sharing it here as well please? ๐Ÿ™ always better to document a bit your findings ๐Ÿ™‚

Cheers โœŒ๏ธ