MVIG-SJTU / AlphaPose

Real-Time and Accurate Full-Body Multi-Person Pose Estimation&Tracking System
http://mvig.org/research/alphapose.html
Other
7.92k stars 1.97k forks source link

nPose_nms文件的pose_nms方法存在内存泄漏问题 #398

Open macaulishchina opened 5 years ago

macaulishchina commented 5 years ago

你好,在使用的过程中发现存在内存泄漏问题,经过初步的定位,内存泄漏大概率出现在非极值抑制方法的这个循环中,我尝试解决这个问题,但是失败了,还希望作者指点一下,一起解决这个问题。

def pose_nms(bboxes, bbox_scores, pose_preds, pose_scores):
   # 部分代码
    while(human_scores.shape[0] != 0):
        # Pick the one with highest score
        pick_id = torch.argmax(human_scores)
        pick.append(human_ids[pick_id])
        # num_visPart = torch.sum(pose_scores[pick_id] > 0.2)

        # Get numbers of match keypoints by calling PCK_match
        ref_dist = ref_dists[human_ids[pick_id]]
        simi = get_parametric_distance(pick_id, pose_preds, pose_scores, ref_dist)
        num_match_keypoints = PCK_match(pose_preds[pick_id], pose_preds, ref_dist)

        # Delete humans who have more than matchThreds keypoints overlap and high similarity
        delete_ids = torch.from_numpy(np.arange(human_scores.shape[0]))[(simi > gamma) | (num_match_keypoints >= matchThreds)]

        if delete_ids.shape[0] == 0:
            delete_ids = pick_id
        # else:
        #     delete_ids = torch.from_numpy(delete_ids)

        merge_ids.append(human_ids[delete_ids])
        pose_preds = np.delete(pose_preds, delete_ids, axis=0)
        pose_scores = np.delete(pose_scores, delete_ids, axis=0)
        human_ids = np.delete(human_ids, delete_ids)
        human_scores = np.delete(human_scores, delete_ids, axis=0)
        bboxes = np.delete(bboxes, delete_ids, axis=0)
        bbox_scores = np.delete(bbox_scores, delete_ids, axis=0)
Fang-Haoshu commented 5 years ago

Hi, thanks. We will look into that.

ICTwangbiao commented 4 years ago

Hi, have you fixed this bug? Could you share your solution?

murdockhou commented 4 years ago

Meet same question. Has it been solved?

ICTwangbiao commented 4 years ago

Hi, have you fixed this bug? Could you share your solution?

I just installed my pytorch down to version=0.4.1 and fixed this bug.