second.pytorch icon indicating copy to clipboard operation
second.pytorch copied to clipboard

Train NuScenesVelo error

Open Giofist opened this issue 4 years ago • 1 comments

I've uncommented the specific line in the config file plus generated the correct dataset but i'm experiencing always this error: Traceback (most recent call last): File "second/pytorch/train.py", line 298, in train for example in dataloader: File "/opt/conda/envs/py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 819, in next return self._process_data(data) File "/opt/conda/envs/py36/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 846, in _process_data data.reraise() File "/opt/conda/envs/py36/lib/python3.6/site-packages/torch/_utils.py", line 385, in reraise raise self.exc_type(msg) ValueError: Caught ValueError in DataLoader worker process 0. Original Traceback (most recent call last): File "/opt/conda/envs/py36/lib/python3.6/site-packages/torch/utils/data/_utils/worker.py", line 178, in _worker_loop data = fetcher.fetch(index) File "/opt/conda/envs/py36/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/opt/conda/envs/py36/lib/python3.6/site-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/exp/second/pytorch/builder/input_reader_builder.py", line 42, in getitem return self._dataset[idx] File "/exp/second/data/nuscenes_dataset.py", line 141, in getitem example = self._prep_func(input_dict=input_dict) File "/exp/second/data/preprocess.py", line 222, in prep_pointcloud calib=calib) File "/exp/second/core/sample_ops.py", line 137, in sample_all avoid_coll_boxes) File "/exp/second/core/sample_ops.py", line 252, in sample_class_v2 boxes = np.concatenate([gt_boxes, sp_boxes], axis=0).copy() File "<array_function internals>", line 6, in concatenate ValueError: all the input array dimensions for the concatenation axis must match exactly, but along dimension 1, the array at index 0 has size 7 and the array at index 1 has size 9

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "second/pytorch/train.py", line 663, in fire.Fire() File "/opt/conda/envs/py36/lib/python3.6/site-packages/fire/core.py", line 138, in Fire component_trace = _Fire(component, args, parsed_flag_args, context, name) File "/opt/conda/envs/py36/lib/python3.6/site-packages/fire/core.py", line 468, in _Fire target=component.name) File "/opt/conda/envs/py36/lib/python3.6/site-packages/fire/core.py", line 672, in _CallAndUpdateTrace component = fn(*varargs, **kwargs) File "second/pytorch/train.py", line 421, in train print(json.dumps(example["metadata"], indent=2)) UnboundLocalError: local variable 'example' referenced before assignment

Someone did the training including velocity infos? Thanks

Giofist avatar Jan 14 '21 10:01 Giofist

Hi, as far as I remember we need to change three things to use velocity infos:

  1. Create dataset with velocity data using NuscenesDatasetVelo class name.
  2. Uncomment custom_values fields in config file.
  3. Modify dataset_class_name fields to NuscenesDatasetVelo in config file.

My best guess is that you missed the last one because the error is saying gt_bboxes size is 7. Hope it helps.

tojimahammatov avatar Mar 11 '21 03:03 tojimahammatov