Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when inference with other datasest #86

Closed
NLCharles opened this issue Aug 7, 2019 · 12 comments
Closed

Error when inference with other datasest #86

NLCharles opened this issue Aug 7, 2019 · 12 comments

Comments

@NLCharles
Copy link

NLCharles commented Aug 7, 2019

Hello, developers. I trained the model on KITTI object dataset and I tried to use it on another point cloud dataset, but the dataloader crashed. May you give some advice on this issus?
I made my point cloud dataset KITTI-like: it has identity calibration file and lidar and label folders. but no pictures. I set a flag to ignore the image input. Unfortunately the rpn couldn't get the correct samples.
File ".../PointRCNN-master/tools/../lib/datasets/kitti_rcnn_dataset.py", line 238, in getitem
return self.get_rpn_sample(index)
File ".../PointRCNN-master/tools/../lib/datasets/kitti_rcnn_dataset.py", line 304, in get_rpn_sample
extra_choice = np.random.choice(choice, self.npoints - len(pts_rect), replace=False)
File "mtrand.pyx", line 1168, in mtrand.RandomState.choice
ValueError: Cannot take a larger sample than population when 'replace=False'

@bmankirLinker
Copy link

I have solved that by changing the extra_choice = np.random.choice(choice, self.npoints - len(pts_rect), replace=True)
since the random choice of required points can't be picked if no replacement when it's more than samples, thus have to switch to true. Moreover, if your number of sample points is way less compared to KITTI such as in NuScenes you gotta tweak many things, which I'm also working on to get sufficient accuracy results :)

@NLCharles
Copy link
Author

Thanks. May you give me some hints on how to fine tune the model on a small dataset for specific purpose?

@candisjesus
Copy link

I also try to train the model on my own dataset, I didn't have the problem as u said since my points are 6 times more than KITTI. I do found some hyper-parameters, i.e. LOC_SCOPE, LOC_BIN_SIZE, CLS_MEAN_SIZE

@bmankirLinker
Copy link

I'm also experimenting tbh, but I can recommend reducing the number of sample points NUM_POINTS in RPN of cfg around something the mean of the sample point number of your data, closest value maybe to a power of 2.

@bmankirLinker
Copy link

I also try to train the model on my own dataset, I didn't have the problem as u said since my points are 6 times more than KITTI. I do found some hyper-parameters, i.e. LOC_SCOPE, LOC_BIN_SIZE, CLS_MEAN_SIZE

Those are more class-related if that's your purpose I recommend to follow PointPillars paper setting definition. On the tweaking for the data side, even the augmentation settings would affect the results I would say, so many tweaks to be done.

@NLCharles
Copy link
Author

OK. Thank you very much. One last question: Is it correct to infer on a different dataset with the model trained on KITTI by only changing the paths of dataloader functions in kittidataset.py? No more actions on augmented scenes or rpn features?

@NLCharles
Copy link
Author

I also try to train the model on my own dataset, I didn't have the problem as u said since my points are 6 times more than KITTI. I do found some hyper-parameters, i.e. LOC_SCOPE, LOC_BIN_SIZE, CLS_MEAN_SIZE

Make sense, since the line the script crashed is all about sample numbers. BTW, do you use the default parameters in the config file?

@bmankirLinker
Copy link

OK. Thank you very much. One last question: Is it correct to infer on a different dataset with the model trained on KITTI by only changing the paths of dataloader functions in kittidataset.py? No more actions on augmented scenes or rpn features?

Using KITTI pre-trained model is indeed fine if your data is coming from a similar distribution which you can ensure that by the inference eval results. I don't get the second part of your question.

@candisjesus
Copy link

I also try to train the model on my own dataset, I didn't have the problem as u said since my points are 6 times more than KITTI. I do found some hyper-parameters, i.e. LOC_SCOPE, LOC_BIN_SIZE, CLS_MEAN_SIZE

Make sense, since the line the script crashed is all about sample numbers. BTW, do you use the default parameters in the config file?

I modified some items I said before. My dataset is consist of depth images captured by binocular camera and then I transformed these depth images to point clouds. Maybe both of us should follow PointPillars paper setting definition as recommended.

@NLCharles
Copy link
Author

OK. Thank you very much. One last question: Is it correct to infer on a different dataset with the model trained on KITTI by only changing the paths of dataloader functions in kittidataset.py? No more actions on augmented scenes or rpn features?

Using KITTI pre-trained model is indeed fine if your data is coming from a similar distribution which you can ensure that by the inference eval results. I don't get the second part of your question.

Excuse me for unable to make it clear. I trained the rcnn with offline method so finetuning the network may call for actions on the data (but I changed it to online, so it's not an issue now). If I want to finetune RPN I might need to do the same thing. Is the checkpoint of an rcnn the only parameter file we need to evaluate, finetune or infer on a dataset? What about rpn? (including the default.yaml)

@bmankirLinker
Copy link

OK. Thank you very much. One last question: Is it correct to infer on a different dataset with the model trained on KITTI by only changing the paths of dataloader functions in kittidataset.py? No more actions on augmented scenes or rpn features?

Using KITTI pre-trained model is indeed fine if your data is coming from a similar distribution which you can ensure that by the inference eval results. I don't get the second part of your question.

Excuse me for unable to make it clear. I trained the rcnn with offline method so finetuning the network may call for actions on the data (but I changed it to online, so it's not an issue now). If I want to finetune RPN I might need to do the same thing. Is the checkpoint of an rcnn the only parameter file we need to evaluate, finetune or infer on a dataset? What about rpn? (including the default.yaml)

Indeed you can update some params in RPN side but better consult PointNet++ paper. And as I have mentioned before you better update the number of points if the average number of points in your samples is different drastically which is also in the RPN side of config.

@hadiTab
Copy link

hadiTab commented Nov 23, 2019

I set a flag to ignore the image input. Unfortunately the rpn couldn't get the correct samples.

Where is this flag set? I can't find it. Having issues getting the network to ignore images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants