ma-xu / pointMLP-pytorch

[ICLR 2022 poster] Official PyTorch implementation of "Rethinking Network Design and Local Geometry in Point Cloud: A Simple Residual MLP Framework"
Apache License 2.0
501 stars 65 forks source link

Failed to test PointMLP in classification_ModelNet40 #76

Closed kaimingkuang closed 1 year ago

kaimingkuang commented 1 year ago

Hi, I was trying to run pointMLP-pytorch/classification_ModelNet40/models/pointmlp.py and got the following error:

Traceback (most recent call last):
  File "../../pointMLP-pytorch/classification_ModelNet40/models/pointmlp.py", line 366, in <module>
    out = model(data)
  File "/kaiming-fast-vol/anaconda3/envs/pointmlp/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "../../pointMLP-pytorch/classification_ModelNet40/models/pointmlp.py", line 338, in forward
    xyz, x = self.local_grouper_list[i](xyz, x.permute(0, 2, 1))  # [b,g,3]  [b,g,k,d]
  File "/kaiming-fast-vol/anaconda3/envs/pointmlp/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
    return forward_call(*input, **kwargs)
  File "../../pointMLP-pytorch/classification_ModelNet40/models/pointmlp.py", line 161, in forward
    fps_idx = pointnet2_utils.furthest_point_sample(xyz, self.groups).long()  # [B, npoint]
  File "/kaiming-fast-vol/anaconda3/envs/pointmlp/lib/python3.7/site-packages/pointnet2_ops/pointnet2_utils.py", line 54, in forward
    out = _ext.furthest_point_sampling(xyz, npoint)
RuntimeError: falseINTERNAL ASSERT FAILED at "pointnet2_ops/_ext-src/src/sampling.cpp":83, please report a bug to PyTorch. CPU not supported

Here is my hardware/software configuration:

kaimingkuang commented 1 year ago

Turns out the FPS module does not support CPU mode. I sent the tensor and the model to GPU and fixed it:

if __name__ == '__main__':
    data = torch.rand(2, 3, 1024).cuda()
    print("===> testing pointMLP ...")
    model = pointMLP().cuda()
    out = model(data)
    print(out.shape)
ma-xu commented 1 year ago

@kaimingkuang The lib does not support cpu operations.

kaimingkuang commented 1 year ago

Thanks! It would be better if this test code could be fixed.