octree-nn / ocnn-pytorch

Octree-based Sparse Convolutional Neural Networks
MIT License
150 stars 16 forks source link

features in Octree object is a list of None #30

Closed junmeng6025 closed 4 months ago

junmeng6025 commented 5 months ago

Hi, I'm facing an issue about generating octree feature. I've already generated Octree upon point cloud successfully, with attributions children, neighbor etc, but the attribution features is a list of None.

Snipaste_2024-04-04_12-02-22

When I try to generate feature data using ocnn.modules.InputFeature, it claims an error:

Exception has occurred: TypeError
unsupported operand type(s) for *: 'Tensor' and 'NoneType'
  File "/root/OpenPCDet/pcdet/models/backbones_3d/vfe/pillarmamba_vfe.py", line 805, in <module>
    data = octree_feature(octree)
TypeError: unsupported operand type(s) for *: 'Tensor' and 'NoneType'

I think these NoneType might come up due to features and normals, but I have o idea how should these two be generated. Thanks in advance.

wang-ps commented 5 months ago

I guess your input point cloud has only xyz coordinates. It has no normals or other features, such as RGB colors. I suggest you directly use the coordinates as the point feature. To this end, you can use the following function

x = octree.get_input_feature(feature = 'L' or 'P', nempty = True or False)

https://ocnn-pytorch.readthedocs.io/en/latest/modules/octree.html#ocnn.octree.Octree.get_input_feature