spconv
spconv copied to clipboard
PointToVoxel empty_mean cpu error
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])
Same problem, have you solved it?
https://github.com/traveller59/spconv/pull/480
#480
Howdo you use PointToVoxel on GPU?
#480
Howdo you use PointToVoxel on GPU?
PointToVoxel is correct on GPU!