Closed prinzROSE closed 2 years ago
I guess you just spell the attribute wrong, it should be target_layers
not target_layer
. This will lead to the defeat of the initialization of attribute activations_and_grads
. Hope this can help you!
Yes, it should be target_layers (and it should be a list).
(py310) D:\cmi_china\agile_innovation\agile_innovation\backend>flask run
这是来自QQ邮箱的假期自动回复邮件。 您好,我最近正在休假中,无法亲自回复您的邮件。我将在假期结束后,尽快给您回复。
Exception ignored in: <bound method BaseCAM.del of <pytorch_grad_cam.grad_cam.GradCAM object at 0x7fc75494ac88>> Traceback (most recent call last): File "/data/caiyong.wang/bin/anaconda3/envs/gu1/lib/python3.6/site-packages/pytorch_grad_cam/base_cam.py", line 192, in del self.activations_and_grads.release() AttributeError: 'GradCAM' object has no attribute 'activations_and_grads' Traceback (most recent call last): File "/data1/caiyong.wang/song/original_DeepCrack/codes/heat map.py", line 56, in
cam = GradCAM(model=model, target_layer=target_layer, use_cuda=False)
TypeError: init() got an unexpected keyword argument 'target_layer'
hi,I have a problem. please u help me!thank u