Skip to content

predict有问题 #7

@cx330a

Description

@cx330a

我想要生成热力图出现报错
屏幕截图 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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions