rayguan97 / M3DETR

Code base for M3DeTR: Multi-representation, Multi-scale, Mutual-relation 3D Object Detection with Transformers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyError: 'batch_cls_preds'

AbhishekKaushikCV opened this issue · comments

Hey Guys,

  • I am trying to train the model using the given config file link_config_file just for 1 class.
  • but I am getting this key error in the voxel_set_abstraction.py file.
  • error message:
  • File "..../tools/../pcdet/models/__init__.py", line 30, in model_func ret_dict, tb_dict, disp_dict = model(batch_dict) File "....../.pyenv/versions/3.7.7/envs/rp/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "............../tools/../pcdet/models/detectors/ours_3d.py", line 11, in forward batch_dict = cur_module(batch_dict) File "............../.pyenv/versions/3.7.7/envs/rp/lib/python3.7/site-packages/torch/nn/modules/module.py", line 1051, in _call_impl return forward_call(*input, **kwargs) File "............../tools/../pcdet/models/backbones_3d/pfe/voxel_set_abstraction.py", line 593, in forward batch_dict = self.reduce_points(batch_dict) File "............/tools/../pcdet/models/backbones_3d/pfe/voxel_set_abstraction.py", line 542, in reduce_points for bs_idx, roi in enumerate(batch_dict['batch_cls_preds']): KeyError: 'batch_cls_preds'
  • I tried to print the batch_dict before the function call for reduce_points, and there is no key named as batch_cls_preds
  • the dict I got is this BATCH_DICT: dict_keys(['points', 'frame_id', 'sample_idx', 'gt_boxes', 'use_lead_xyz', 'voxels', 'voxel_coords', 'voxel_num_points', 'metadata', 'batch_size', 'voxel_features', 'encoded_spconv_tensor', 'encoded_spconv_tensor_stride', 'multi_scale_3d_features', 'multi_scale_3d_strides', 'spatial_features', 'spatial_features_stride'])
  • what could be the cause for this error? how can I solve this error?

Thanks in Advance!!

Hi,

I just tried 'bash ./scripts/dist_train.sh 1 --cfg_file ./cfgs/m3detr_models/m3detr_kitti.yaml --workers 4' on my local machine, which does not give me an error. I also tried to change the config to only one class without any issues.

Since the waymo dataset has been deleted locally and has to be reprocessed again, I'm not able to try the waymo config file. But it has been tested previously without any error. I just tested KITTI with another GPU and cuda/torch version, which is updated here.

Could you give a bit more details on the error?

  1. Can you try the config files as is, with all of the classes? Can you point out which line in the config file did you change?
  2. Can you make sure you have the env setup correctly and make sure all packages are properly installed?
  3. Can you try the kitti config file and see if you can reproduce the error?

Best,
Tianrui

Hi, I also had this problem when i train it, have you solved it now please?