torch-cam
torch-cam copied to clipboard
What is class_idx in __call__() ??
Hello sir, I want to display heat-map for my classification task. So i found your library. What is class_idx of call()?? (I think that it is class index of top-1)
And, Using my datasets, I met nan. In compute_cam() of core.py My result of torch.nansum has all < 0. Then F.relu return all 0. So, in normalization, it return nan.
Is this nornal?? If not, what should i change in my data??
Thanks. Edward cho
Hi there 👋
a CAM is relative to the class output of the model, not necessarily the top 1. So this arg needs to be an integer in the range of (0, N - 1) where N is the number of output classes ;)
Regarding your error, I would need a minimal runnable snippet to reproduce as I'm not sure what you mean here :/ For issues, it's better to fill the bug report template next time please 🙏
Cheers ✌️
Hi there 👋
a CAM is relative to the class output of the model, not necessarily the top 1. So this arg needs to be an integer in the range of (0, N - 1) where N is the number of output classes ;)
Regarding your error, I would need a minimal runnable snippet to reproduce as I'm not sure what you mean here :/ For issues, it's better to fill the bug report template next time please 🙏
Cheers ✌️
Hello sir. As you know, the CAM is for checking of decision of deep learning tasks, i think. So i want to use evidence of top-1 on classification task. If so, class-idx should be class index of top-1. Right??
Thanks, Edward cho
If so, class-idx should be class index of top-1. Right??
As mentioned above, yes you can!
However regarding your error, I'll need a runnable snippet to reproduce this behaviour 🙏
Any update @edwardcho ? :)
Hello @edwardcho :wave:
Mind providing a minimal script to reproduce the behavior you described? :pray: Otherwise I'll close the issue since I cannot do anything about this without more details :sweat_smile:
The NaN problem you mention is fixed by #185. For the rest, I have no way of reproducing it, so I'm closing the issue! Feel free to reopen if you encounter some trouble :)