Error in classification_ModelNet40/models/pointmlp.py
Hi, Thanks for your sharing!
I try to test the pointmlp model and this bug just occured:
project/pointMLP-pytorch/classification_ModelNet40/models# python pointmlp.py
===> testing pointMLP ...
Traceback (most recent call last):
File "pointmlp.py", line 366, in
And then I test whether my cuda is available: Python 3.7.16 (default, Jan 17 2023, 22:20:44) [GCC 11.2.0] :: Anaconda, Inc. on linux Type "help", "copyright", "credits" or "license" for more information.
import torch torch.cuda.is_available() True
It seems like my cuda is setting properly. Could you please help me with this confused bug? Hoping for your reply,Thansk!
You need to install pointnet2_ops_lib/.
You could alternatively use pytorch geometrics fps which would require some changes, but you wouldn't need to install anything.
One possible solution is to do something like this:
# from torch_geometric.nn import fps
xyz_reshaped = xyz.view(-1, 3) # required since fps expected (batch_size * num points, 3)
batch_size, num_points = xyz.shape[0], xyz.shape[1]
batch = torch.arange(batch_size).repeat_interleave(num_points).to(xyz.device)
fps_idx = fps(xyz_reshaped, batch, ratio=S/num_points).view(batch_size, -1)
fps_idx = fps_idx % num_points
# code would continue normally
I haven't tested this extensively, but it should work.