IndexError: tensors used as indices must be long, byte or bool tensors
xiaosa269 opened this issue · 0 comments
Thank you very much for your work!
I am currently trying to build a feature fusion module based on PointTransformer V3 using sparse convolutions. However, I encountered the following issue when using spconv.SparseGlobalAvgPool, which did not occur when using spconv.SubMConv3d:
-- Process 0 terminated with the following error:
Traceback (most recent call last):
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
fn(i, *args)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/engines/launch.py", line 137, in _distributed_worker
main_func(*cfg)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/tools/train.py", line 20, in main_worker
trainer.train()
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/engines/train.py", line 168, in train
self.run_step()
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/engines/train.py", line 182, in run_step
output_dict = self.model(input_dict)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 1008, in forward
output = self._run_ddp_forward(*inputs, **kwargs)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/parallel/distributed.py", line 969, in _run_ddp_forward
return module_to_run(*inputs[0], **kwargs[0])
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/default.py", line 55, in forward
point = self.backbone(point)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/point_transformer_v3/point_transformer_v3m1_base.py", line 1087, in forward
point = self.enc(point)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/modules.py", line 62, in forward
input = module(input)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/modules.py", line 62, in forward
input = module(input)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/point_transformer_v3/point_transformer_v3m1_base.py", line 683, in forward
point=self.iaff(conv_feat,point)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/point_transformer_v3/point_transformer_v3m1_base.py", line 310, in forward
xg = self.global_att(xa2)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/data/xhy_code/Pointcept/exp/semantic_kitti/semantic_kitti_codataset_ptv3_ronghe_base3_batch_6_num_16_epoch_300_share_1/code/pointcept/models/modules.py", line 66, in forward
input.sparse_conv_feat = module(input.sparse_conv_feat)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1130, in _call_impl
return forward_call(*input, **kwargs)
File "/home/xhy/miniconda3/envs/pointcept/lib/python3.8/site-packages/spconv/pytorch/pool.py", line 271, in forward
real_features = input.features[real_inds]
IndexError: tensors used as indices must be long, byte or bool tensors
Could you please advise me on how to resolve this issue? Thank you very much for your help.