Closed jouhy closed 1 year ago
@jouhy Even after changing the "VoxelGenerator" to "PointToVoxel", I still encountered the following issue:
File "/data/DSGN2/pcdet/datasets/processor/data_processor.py", line 198, in transform_points_to_voxels voxel_output = voxel_generator.generate(points) AttributeError: 'PointToVoxel' object has no attribute 'generate'
May I know how you resolved this issue when using spconv2.x?
@bringeyes ./pcdet/models/backbones_3d_lidar/spconv_backbone.py I changed the code in the above file to the following.
import spconv.pytorch as spconv # instead import spconv
@jouhy Yes, I had made the modification you mentioned before encountering the error. The reason for this error is that the original project used spconv1.x version and VoxelGenerator.generate() used in the file ./pcdet/datasets/processor/data_processor.py also comes from spconv1.x. Therefore, merely modifying "VoxelGenerator" to "PointToVoxel" is not sufficient, and subsequent code needs to be modified accordingly. Did you make the corresponding modifications?
@bringeyes yes, I fixed it in the file ./pcdet/datasets/processor/data_processor.py with:
points = data_dict['points']
points_torch = torch.from_numpy(points)
voxels, coordinates, num_points = voxel_generator(points_torch, empty_mean=True)
# if isinstance(voxel_output, dict):
# voxels, coordinates, num_points = \
# voxel_output['voxels'], voxel_output['coordinates'], voxel_output['num_points_per_voxel']
# else:
# voxels, coordinates, num_points = voxel_output
@jouhy Thank you very much for your help! The error has been resolved now!!
We trained the dsgn2 model, but there is a significant difference in performance between training and evaluation.
Our system construction is as follows.
We encountered an error with the VoxelGenerator, so we made changes to the code as shown below [issue #10].