question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug in sample_points function in data_processor.py when training PointRCNN_iou

See original GitHub issue

In the following code:

       if (num_points < len(points)): 
            pts_depth = np.linalg.norm(points[:, 0:3], axis=1)
            pts_near_flag = pts_depth < 40.0
            far_idxs_choice = np.where(pts_near_flag==0)[0]
            near_idxs = np.where(pts_near_flag ==1)[0]
            near_idxs_choice = np.random.choice(near_idxs, num_points - len(far_idxs_choice), replace=False)
            choice = np.concatenate((near_idxs_choice, far_idxs_choice), axis=0 ) \
                if(len(far_idxs_choice) >0) else near_idxs_choice
            np.random.shuffle(choice)

I encounter this error when training point_rcnn_iou:

Near_idxs_choice = np.random.choice (near_idxs, num_points - len(far_idxs_choice), replace = False) 
 File "mtrand.pyx", line 951, in numpy.random.mtrand.RandomState.choice
ueError: negative dimensions are not allowed

This should be possibly because the length of far_idxs_choice is larger than the default number of points16384.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
sshaoshuaicommented, Aug 5, 2020

Yes, it is just a hyper-parameter based on the point cloud range. Actually I am not sure whether the performance will drop if we simply simple 16384 points from the whole point cloud. This parameter aimed to balance the number of points in nearby and far away areas since the random sampling may sample much more points in the nearby area.

1reaction
sshaoshuaicommented, Aug 4, 2020

Thank you for the report! It is indeed a bug and I didn’t consider that situation since it is impossible in the KITTI dataset. You could submit a PR to fix it or I will find time to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found