is it possible to use the provided cams with own models? #135
-
Hello torch-cam providers :) it is possible for example to train an own CNN and then use the provided CAM methods? If yes, in which way, what should be considered? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Hello there @cherepanovic 👋 This is entirely possible, the whole project was meant for people willing to check class activation maps on their custom CNN architecture 👍 To do this, I'd suggest checking the example in the README: https://github.com/frgfm/torch-cam#retrieving-the-class-activation-map Let me know if it's still confusing 👍 |
Beta Was this translation helpful? Give feedback.
-
@frgfm, Please give me a example of our own CNN model. I have saved my model without dictionary and I tried a lot to apply class activation map but still it didn't work out.
|
Beta Was this translation helpful? Give feedback.
-
@frgfm thank you, I have solved above problem and I am using GradCAM for class activation map but i think it didn't work correctly. I have attached a link to visualize image. The accuracy of my model is 82% Working Code
Results |
Beta Was this translation helpful? Give feedback.
-
@frgfm thank you for work and time. Yes, "the problem is when you want it to work with almost everything" you are right |
Beta Was this translation helpful? Give feedback.
Hello there @cherepanovic 👋
This is entirely possible, the whole project was meant for people willing to check class activation maps on their custom CNN architecture 👍
To do this, I'd suggest checking the example in the README: https://github.com/frgfm/torch-cam#retrieving-the-class-activation-map
You'll only have to change the model definition from
model = resnet18(pretrained=True).eval()
to your custom architecture definition (+ loading your trained parameters)Let me know if it's still confusing 👍