spconv icon indicating copy to clipboard operation
spconv copied to clipboard

PointToVoxel empty_mean cpu error

Open fuyawangye opened this issue 3 years ago • 4 comments

PointToVoxel empty_mean=True the empty values of voxels which after the first are error on CPU; the values are correct on GPU;

spconv-cu111 2.1.21 Python 3.6.9 Ubuntu 18.04.6 LTS

import torch
from spconv.pytorch.utils import PointToVoxel, gather_features_by_pc_voxel_id

voxel_size = [0.5, 0.5, 0.5]
pointcloud_range = [0, -5, 0, 10, 5, 10]
num_point_feature = 4
max_num_voxel = 8
max_num_points_per_voxel = 10

points = torch.rand((40, 4), dtype=torch.float32) * 10
# device = torch.device("cuda:0")
device = torch.device("cpu:0")
points = points.to(device)


gen = PointToVoxel(
    vsize_xyz=voxel_size,
    coors_range_xyz=pointcloud_range,
    num_point_features=num_point_feature,
    max_num_voxels=max_num_voxel,
    max_num_points_per_voxel=max_num_points_per_voxel,
    device=device)

voxels, coords, num_points_per_voxel = gen(pc=points, empty_mean=False)
voxels_, _, _ = gen(pc=points, empty_mean=True)
print(voxels[0])
print(voxels[1])
print(voxels_[0])
print(voxels_[1])

fuyawangye avatar May 20 '22 09:05 fuyawangye

Same problem, have you solved it?

KyleYueye avatar Jul 04 '22 14:07 KyleYueye

https://github.com/traveller59/spconv/pull/480

fuyawangye avatar Jul 05 '22 09:07 fuyawangye

#480

Howdo you use PointToVoxel on GPU?

KyleYueye avatar Jul 05 '22 11:07 KyleYueye

#480

Howdo you use PointToVoxel on GPU?

PointToVoxel is correct on GPU!

fuyawangye avatar Jul 06 '22 09:07 fuyawangye