jacobgil / pytorch-grad-cam

Advanced AI Explainability for computer vision. Support for CNNs, Vision Transformers, Classification, Object detection, Segmentation, Image similarity and more.
https://jacobgil.github.io/pytorch-gradcam-book
MIT License
10.3k stars 1.54k forks source link

Generating CAMs using pro-gigapath model #509

Open ghost opened 3 months ago

ghost commented 3 months ago

Hi, I am trying to generate CAMs from Microsoft's prov-gigapath model. I am getting:

RuntimeError: shape [1,14,14,1536] is invalid for input of size 393216.

I am using the modifying vit_example available under the usage_examples folder. I am getting an error in reshape_transformsfunction.

result = tesnsor[: ,1 : , : ].reshape(tensor.size(0), I am getting error in this line. Please help me to resolve this issue.