Closed zyrant closed 2 years ago
@zyrant This error usually implies the coordinates (coords01x) being out of the point cloud range. You can print the coords[:, 0].max(), coords[:, 1].max(), coords[:, 2].max() in the debug console.
thank you for your reply. I print the coords use
print( '0max:',coords.int()[:,0].max(), '1max: ',coords.int()[:,1].max(), '2max: ', coords.int()[:,2].max(),'3max: ', coords.int()[:,3].max())
print('bev_shape : ',bev_shape)
and get the results
0max: tensor(1, device='cuda:0', dtype=torch.int32) 1max: tensor(215, device='cuda:0', dtype=torch.int32) 2max: tensor(232, device='cuda:0', dtype=torch.int32) 3max: tensor(1, device='cuda:0', dtype=torch.int32)
bev_shape : [216, 248, 1]
thank you for your reply. I print the coords use
print( '0max:',coords.int()[:,0].max(), '1max: ',coords.int()[:,1].max(), '2max: ', coords.int()[:,2].max(),'3max: ', coords.int()[:,3].max()) print('bev_shape : ',bev_shape)
and get the results
0max: tensor(1, device='cuda:0', dtype=torch.int32) 1max: tensor(215, device='cuda:0', dtype=torch.int32) 2max: tensor(232, device='cuda:0', dtype=torch.int32) 3max: tensor(1, device='cuda:0', dtype=torch.int32) bev_shape : [216, 248, 1]
It seems some points fall out of the range on Z-axis(height). The coords.int()[:, 3].max() should be 0 since we got only one voxel (acutually a pillar) for each XY position.
Yes, you are right. I use the official code of openPCDet-master. i find the _mask_points_byrange function in common_utils.py is
def mask_points_by_range(points, limit_range):
mask = (points[:, 0] >= limit_range[0]) & (points[:, 0] <= limit_range[3]) \
& (points[:, 1] >= limit_range[1]) & (points[:, 1] <= limit_range[4])
return mask
It's strange that it doesn't limit the range of the point cloud on the Z axis. So I added a z-axis constraint based on your code.
def mask_points_by_range(points, limit_range):
# mask = (points[:, 0] >= limit_range[0]) & (points[:, 0] <= limit_range[3]) \
# & (points[:, 1] >= limit_range[1]) & (points[:, 1] <= limit_range[4])
mask = (points[:, 0] > limit_range[0] + 1e-4) & (points[:, 0] < limit_range[3] - 1e-4) \
& (points[:, 1] > limit_range[1] + 1e-4) & (points[:, 1] < limit_range[4] - 1e-4) \
& (points[:, 2] > limit_range[2] + 1e-4) & (points[:, 2] < limit_range[5] - 1e-4)
return mask
Last, everything is okay, and thank you for your answer.
First of all, thank you for your work. it seems that you have update the version of pcdet from 0.3 to 0.5, and data_processor.py gets a new version. such as
to
when I try the latest version, I get a problem, so I change the code to
and it works. Then I got a new bug again.
I have tried my best to solve this problem, but get noting, can you give me some advice? Actually, when i use your code with pcdet 0.3,everything is okay.