z1069614715 / pytorch-classifier

image classifier implement in pytoch.
MIT License
98 stars 18 forks source link

predict有问题 #7

Open cx330a opened 3 months ago

cx330a commented 3 months ago

我想要生成热力图出现报错 屏幕截图 2024-05-31 155623

Exception ignored in: <function BaseCAM.del at 0x00000198F079A040> Traceback (most recent call last): File "D:\Users\15318\anaconda3\envs\pytorch\lib\site-packages\pytorch_grad_cam\base_cam.py", line 196, in del self.activations_and_grads.release() AttributeError: 'GradCAM' object has no attribute 'activations_and_grads' Traceback (most recent call last): File "d:/pytorch-classifier-master/pytorch-classifier-master/predict.py", line 65, in cam_model = cam_visual(model, test_transform,DEVICE, opt) File "d:\pytorch-classifier-master\pytorch-classifier-master\utils\utils.py", line 664, in init self.cam_model = eval(opt.cam_type)(model=model, target_layers=model.cam_layer(), use_cuda=(DEVICE.type != 'cpu')) TypeError: init() got an unexpected keyword argument 'use_cuda'