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

IndexError: argmin(): Expected reduction dim to be specified for input.numel() == 0. #28

Open
tyutlk opened this issue Jun 1, 2023 · 1 comment

Comments

@tyutlk
Copy link

tyutlk commented Jun 1, 2023

Traceback (most recent call last):
File "train.py", line 231, in
main()
File "train.py", line 200, in main
cfg=cfg
File "dev0510/OpenPCDet/tools/train_utils/train_utils.py", line 194, in train_model
use_amp=use_amp
File "dev0510/OpenPCDet/tools/train_utils/train_utils.py", line 56, in train_one_epoch
loss, tb_dict, disp_dict = model_func(model, batch)
File "../pcdet/models/init.py", line 44, in model_func
ret_dict, tb_dict, disp_dict = model(batch_dict)
File "miniconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "/miniconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 1040, in forward
output = self._run_ddp_forward(*inputs, **kwargs)
File "miniconda3/envs/py37/lib/python3.7/site-packages/torch/nn/parallel/distributed.py", line 1000, in _run_ddp_forward
return module_to_run(*inputs[0], **kwargs[0])
File "miniconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "../pcdet/models/detectors/voxelnext.py", line 11, in forward
batch_dict = cur_module(batch_dict)
File "miniconda3/envs/py37/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1194, in _call_impl
return forward_call(*input, **kwargs)
File "../pcdet/models/dense_heads/voxelnext_head.py", line 535, in forward
data_dict['gt_boxes'], num_voxels, spatial_indices, spatial_shape
File "../pcdet/models/dense_heads/voxelnext_head.py", line 160, in assign_targets
min_radius=target_assigner_cfg.MIN_RADIUS,
File "../pcdet/models/dense_heads/voxelnext_head.py", line 225, in assign_target_of_single_head
inds[k] = distance.argmin()
IndexError: argmin(): Expected reduction dim to be specified for input.numel() == 0.

Hi,thanks for your great work,when training my own dataset using my own data augmentation,the ERROR always occurs randomly after training serveral epochs , so i wonder how it works and whether made by my own dataset and my own data augmentation.

@yukang2017
Copy link
Member

Hi, I think this might be caused from that the voxel features in some frames are very few. I think you can add a line of continue to skip the computation if distance.numel() == 0.

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

2 participants