I’m not sure if the problem is the hook, for during training I set “gradCAM = False”. Also, I’m using Google Colab, so I don’t think I can check GPU usage. I did the following modification and it didn’t change the performance, which is much slower than if I just use the model from torchvision:

I’m considering discarding this approach and creating a separate module to get my visualization, totally apart from my training.