报错信息如下(错误的关键已用红色标出):
Traceback (most recent call last):
File "D:\langsongsong\file\pytorch-classifier-master\predict.py", line 71, in <module>
cam_model = cam_visual(model, test_transform, DEVICE, opt)
File "D:\langsongsong\file\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'))
File "C:\Users\langsongsong\AppData\Roaming\Python\Python39\site-packages\pytorch_grad_cam\grad_cam_plusplus.py", line 10, in __init__
super(GradCAMPlusPlus, self).__init__(model, target_layers, use_cuda,
File "C:\Users\langsongsong\AppData\Roaming\Python\Python39\site-packages\pytorch_grad_cam\base_cam.py", line 27, in __init__
self.activations_and_grads = ActivationsAndGradients(
File "C:\Users\langsongsong\AppData\Roaming\Python\Python39\site-packages\pytorch_grad_cam\activations_and_gradients.py", line 11, in __init__
for target_layer in target_layers:
TypeError: 'Hardswish' object is not iterable
Exception ignored in: <function BaseCAM.__del__ at 0x0000022B7113A160>
Traceback (most recent call last):
File "C:\Users\langsongsong\AppData\Roaming\Python\Python39\site-packages\pytorch_grad_cam\base_cam.py", line 192, in __del__
self.activations_and_grads.release()
AttributeError: 'GradCAMPlusPlus' object has no attribute 'activations_and_grads'