Pointnet_Pointnet2_pytorch icon indicating copy to clipboard operation
Pointnet_Pointnet2_pytorch copied to clipboard

Training on custom Dataset

Open Dhagash4 opened this issue 3 years ago • 10 comments

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

Dhagash4 avatar May 24 '21 14:05 Dhagash4

Have you found the solution?

lakshmipriya369 avatar Aug 03 '21 17:08 lakshmipriya369

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.

pytholic avatar Aug 09 '21 07:08 pytholic

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..

pytholic avatar Aug 10 '21 07:08 pytholic

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?

lakshmipriya369 avatar Aug 15 '21 16:08 lakshmipriya369

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.

pytholic avatar Aug 17 '21 09:08 pytholic

@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 avatar Sep 07 '21 08:09 davodogster

@davodogster Hi, here is the updated link: https://github.com/rajahaseeb147/3dFacialPartSegmentation/blob/main/Deep%20Learning/Implementation_3/data_utils/CustomDataLoader.py

pytholic avatar Sep 07 '21 08:09 pytholic

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 avatar Sep 13 '21 07:09 chrstrbmr

@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

1

pytholic avatar Sep 14 '21 01:09 pytholic

@chrstrbmr you can also see my dataloader script in the above comments.

pytholic avatar Sep 14 '21 01:09 pytholic