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.66k stars 1.56k forks source link

ImportError: cannot import name 'GradCAM' from 'pytorch_grad_cam' #318

Closed Panghema closed 2 years ago

Panghema commented 2 years ago

i used the pytorch_grad_cam as your example doing like '# Construct the CAM object once, and then re-use it on many images: cam = GradCAM(model=model, target_layers=target_layers, use_cuda=args.use_cuda)' but it raise the problem as topic says.

Panghema commented 2 years ago

moreover, i find that there is a class named GradCam, its parameter is different from GradCAM

Panghema commented 2 years ago

i am stupid