Pointnet_Pointnet2_pytorch
Pointnet_Pointnet2_pytorch copied to clipboard
Training on custom Dataset
I have a query I want to train this implementation on the custom dataset. Can you share some light on how the data should look like? Currently, I have a point cloud and each point in point cloud has a label associated with it so while training in batch the input data shape is [8000,3,1] i.e 8000 3D points but it's getting stuck in PointNetSetAbstraction with the following error
IndexError: The shape of the mask [8000, 1024, 1] at index 2 does not match the shape of the indexed tensor [8000, 1024, 32] at index 2
What I can understand is it is something related to npoints, can someone tell what does this parameter mean and what I am supposed to change while training on custom dataset.
Detailed Error
Have you found the solution?
Hi. I also have a similar issue.
I have my own dataset i.e. X, Y, Z points with labels (4 columns in total) in txt files. I wanted to know how I can create a data loader for custom data and train the network.
I finally trained my model. I saved data in Shapenet format also wrote my dataloader by following the shapenet dataloader. My data includes point clouds in .txt format with 4 columns (X, Y, Z, label).
I also had to modify 2 lines in architecture since I have 1 class instead of 16 and 2 parts instead of 50.
However, I want to infer on new data and I need help in that now..
I finally trained my model. I saved data in Shapenet format also wrote my dataloader by following the shapenet dataloader. My data includes point clouds in .txt format with 4 columns (X, Y, Z, label).
I also had to modify 2 lines in architecture since I have 1 class instead of 16 and 2 parts instead of 50.
However, I want to infer on new data and I need help in that now..
Have you uploaded your code in any repo?
Yes @lakshmipriya369 . Here is the link:
https://github.com/rajahaseeb147/SKIA/blob/main/3d_facial_part_segmentation/Deep%20Learning/Implementation_3/data_utils/CustomDataLoader.py
Note that I am not professional, so my repository is just for me, it might look messy. Also, I shifted to some other implementations because I have prediction issues with this one. i can share link if you need.
@rajahaseeb147 Hi I would like to try Pointnet2 on mycustom dataset, I also have txt files with X,Y,Z,label. Can you please share the link for your other implementation?
@davodogster Hi, here is the updated link: https://github.com/rajahaseeb147/3dFacialPartSegmentation/blob/main/Deep%20Learning/Implementation_3/data_utils/CustomDataLoader.py
Hi @rajahaseeb147
Can you tell me what exactly you changed in the architecture ? I am also stuck trying to get it to work for binary classification! Thanks so much!
@chrstrbmr Hi. In the end, I used this repo for my work: https://github.com/nikitakaraevv/pointnet
Mostly I had to change the dataloader function and make it work with my own dataset. If you want to use yanx27 repo for binary classification, then I think you need to change the number of features from 4944 to 4929 in the model, like here (line 29):
https://github.com/rajahaseeb147/3dFacialPartSegmentation/blob/main/Deep%20Learning/Implementation_3/models/pointnet_part_seg.py
@chrstrbmr you can also see my dataloader script in the above comments.