erikwijmans / Pointnet2_PyTorch

PyTorch implementation of Pointnet2/Pointnet++
The Unlicense
1.5k stars 340 forks source link

Classification input data features #123

Closed yangvnks closed 4 years ago

yangvnks commented 4 years ago

Hello,

I'm using a custom dataset containing 3D points to perform SSG classification. My input data has no additional features other than its coordinates xyz. While performing the validation sanity check I get the following error : RuntimeError: Given groups=1, weight of size 64 6 1 1, expected input[32, 3, 512, 64] to have 6 channels, but got 3 channels instead which is thrown by this line of code. In the PointnetSA module the use_xyz block adds +3 to the first MLP element, so instead of expecting 3 point features it expects 6 input features even in the first set abstraction layer. I understand that new features are created along the hierarchy but the first set abstraction layer should be able to work with just its three coordinates (correct me if I'm wrong!). Thanks for any help!

erikwijmans commented 4 years ago

The operations support features=None and having [0] as the first dimension in the MLP is valid. The example model implementations aren't set up to support that however. You will need to modify the initial MLP specs to expect that and/or add a field to the config (e.g. here: https://github.com/erikwijmans/Pointnet2_PyTorch/blob/master/pointnet2/models/pointnet2_ssg_cls.py#L70)

paulm423 commented 4 years ago

Hi @yangvnks

I am also using data with no additionnal features, did you find an easy way to modify the code, so it does not raise an error?

Thanks

yangvnks commented 4 years ago

Hi @paulm423 ,

Fastest way I found was to modify this line with mlp=[0, 64, 64, 128]. This way when using use_xyz only the three coordinates are used. Hope that helps.

AnselmC commented 3 years ago

For others using the SSG segmentation task, you'll need to additionally remove the +6 from this line.