PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.88k stars 2.9k forks source link

目标检测热力图,使用文档中的命令,但是报错AttributeError: 'NoneType' object has no attribute 'squeeze' #7869

Closed Petal99 closed 1 year ago

Petal99 commented 1 year ago

问题确认 Search before asking

请提出你的问题 Please ask your question

目标检测热力图,使用文档中的命令: python tools/cam_ppdet.py -c configs/ppyoloe/ppyoloe_crn_l_300e_coco.yml --infer_img demo/000000014439.jpg --cam_out cam_ppyoloe --target_feature_layer_name model.backbone -o weights=https://paddledet.bj.bcebos.com/models/ppyoloe_crn_l_300e_coco.pdparams, 但是报错AttributeError: 'NoneType' object has no attribute 'squeeze' 位置在cam_utils.py", line 281, in get_bboxes_cams -1].grad.squeeze().cpu().numpy()

环境为:

  1. Win10
  2. paddlepaddle-gpu = 2.4.1.post116
  3. Paddledetection = 2.6
xs1997zju commented 1 year ago

Have u change any code in ppdet-release2.6?, It run successfully for me on linux machine with paddle-2.3

nemonameless commented 1 year ago

please try paddlepaddle-2.3

Petal99 commented 1 year ago

please try paddlepaddle-2.3

谢谢,paddle-2.3版本没有出现这个问题,看来是2.4版本的bug😀