xinge008 / Cylinder3D

Rank 1st in the leaderboard of SemanticKITTI semantic segmentation (both single-scan and multi-scan) (Nov. 2020) (CVPR2021 Oral)
Apache License 2.0
859 stars 180 forks source link

wrong predicted results when running demo_folder.py #123

Open GaloisWang opened 2 years ago

GaloisWang commented 2 years ago

Thank you for your excellent work! When I run demo_folder.py to predict my own dataset (velodyne 64E, same as semanticKITTI), I find that the semantic labels generated by the pre-trained model you provided are all 0. What is the reason? When I replaced my own data with KITTI's 18,19 sequence, I found that the predicted semantic labels were all 0. Where is the problem with this? 11

Pst2000 commented 2 years ago

Same for me... Waiting for an answer

GaloisWang commented 2 years ago

Same for me... Waiting for an answer

have you solved it ?

Pst2000 commented 2 years ago

Same for me... Waiting for an answer

have you solved it ?

Well I have trained a new model instead of using the model provided... And when I run demo_folder.py using my model it still produced a null result. How I solved it is using my_model.load_state_dict(torch.load(xxx)) instead of using load_checkpoint(), then it works...

Do you use the same version of spconv and torch as the author? I think it may be because of the newer version changes some names of the state_dict so the old model's state_dict doesn't match the provided one. Hope it helps !

GaloisWang commented 2 years ago

Same for me... Waiting for an answer

have you solved it ?

Well I have trained a new model instead of using the model provided... And when I run demo_folder.py using my model it still produced a null result. How I solved it is using my_model.load_state_dict(torch.load(xxx)) instead of using load_checkpoint(), then it works...

Do you use the same version of spconv and torch as the author? I think it may be because of the newer version changes some names of the state_dict so the old model's state_dict doesn't match the provided one. Hope it helps !

Could you please upload the code where you have changed? I find that the load_checkpoint() function in load_save_util.py is the same as you changed.Besides, I find that although the predicts shows all zeros my be the pointcloud is too sparse due to the author used sparconv. When I plot the label it predicted, it works and shows perfect. You can plot the plot cloud and labels to judge if the mode has correctly predicted the result.

rdkouhei commented 2 years ago

I had that error too, but it was resolved. The cause is that the model weights are not loaded correctly.

The solution is to replace the model_load_path: ". /model_load_dir/model_load.pt" in config/semantickitti.yaml and replace it with your model.

RandyAndy-byte commented 2 years ago

Have anyone found any other solutions, I have wrote my own tester and the results are random because the predictions are mostly 0

wangsu747 commented 1 year ago

Same for me... Waiting for an answer

have you solved it ?

Well I have trained a new model instead of using the model provided... And when I run demo_folder.py using my model it still produced a null result. How I solved it is using my_model.load_state_dict(torch.load(xxx)) instead of using load_checkpoint(), then it works...

Do you use the same version of spconv and torch as the author? I think it may be because of the newer version changes some names of the state_dict so the old model's state_dict doesn't match the provided one. Hope it helps !

That works. Thanks!

lyysl commented 5 months ago

Same for me... Waiting for an answer

have you solved it ?

Well I have trained a new model instead of using the model provided... And when I run demo_folder.py using my model it still produced a null result. How I solved it is using my_model.load_state_dict(torch.load(xxx)) instead of using load_checkpoint(), then it works...

Do you use the same version of spconv and torch as the author? I think it may be because of the newer version changes some names of the state_dict so the old model's state_dict doesn't match the provided one. Hope it helps !

It seems the size does not match if I change it. I changed the .yaml for the path of the pretrained model but the result is still bad. Anyone solves it? Thx