prs-eth / OverlapPredator

[CVPR 2021, Oral] PREDATOR: Registration of 3D Point Clouds with Low Overlap.
https://shengyuh.github.io/predator/index.html
MIT License
501 stars 70 forks source link

When I train 'modelnet.yaml', I often get the error 'selected index k out of range' #57

Closed ChaunceyQ closed 1 year ago

ChaunceyQ commented 1 year ago

neighborhood: [48 40 43] neighborhood: [48 40 43] neighborhood: [48 40 43] start training... 1%|▏ | 68/5112 [00:10<13:12, 6.37it/s] Traceback (most recent call last): File "E:/@Project/PointCloud/OverlapPredator-main/main.py", line 97, in trainer.train() File "E:\@Project\PointCloud\OverlapPredator-main\lib\trainer.py", line 236, in train self.inference_one_epoch(epoch,'train') File "E:\@Project\PointCloud\OverlapPredator-main\lib\trainer.py", line 193, in inference_one_epoch stats = self.inference_one_batch(inputs, phase) File "E:\@Project\PointCloud\OverlapPredator-main\lib\trainer.py", line 121, in inference_one_batch feats, scores_overlap, scores_saliency = self.model(inputs) #[N1, C1], [N2, C2] File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, kwargs) File "E:\@Project\PointCloud\OverlapPredator-main\models\architectures.py", line 163, in forward src_feats_c, tgt_feats_c = self.gnn(src_pcd_c.unsqueeze(0).transpose(1,2), tgt_pcd_c.unsqueeze(0).transpose(1,2),src_feats_c, tgt_feats_c) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(*input, *kwargs) File "E:\@Project\PointCloud\OverlapPredator-main\models\gcn.py", line 166, in forward desc1 = layer(coords1, desc1) File "D:\Anaconda3\envs\pytorch\lib\site-packages\torch\nn\modules\module.py", line 1130, in _call_impl return forward_call(input, kwargs) File "E:\@Project\PointCloud\OverlapPredator-main\models\gcn.py", line 72, in forward x1 = get_graph_feature(coords, x0.squeeze(-1), self.k) File "E:\@Project\PointCloud\OverlapPredator-main\models\gcn.py", line 28, in get_graph_feature idx = dist.topk(k=k+1, dim=-1, largest=False, sorted=True)[1] #[B, N, K+1], here we ignore the smallest element as it's the query itself
RuntimeError: selected index k out of range

ShengyuH commented 1 year ago

hi,

That's because in the bottleneck we don't have enough nodes to construct the k-nn graph after a series of down-sampling. I simply discarded them. We have {try ... except ...} to handle them.

Shengyu

ShengyuH commented 1 year ago

close due to in-activity.