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

why the info doesn‘t have the attribute image?

Open shaldor0315 opened this issue 5 years ago • 5 comments

Traceback (most recent call last): File "/home/yiqunhe/second.pytorch/second/pytorch/train.py", line 304, in train for example in dataloader: File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 582, in next return self._process_next_batch(batch) File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 606, in _process_next_batch raise Exception("KeyError:" + batch.exc_msg) Exception: KeyError:Traceback (most recent call last): File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in _worker_loop samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 99, in samples = collate_fn([dataset[i] for i in batch_indices]) File "/home/yiqunhe/second.pytorch/second/pytorch/builder/input_reader_builder.py", line 42, in getitem return self._dataset[idx] File "/home/yiqunhe/second.pytorch/second/data/kitti_dataset.py", line 166, in getitem input_dict = self.get_sensor_data(idx) File "/home/yiqunhe/second.pytorch/second/data/kitti_dataset.py", line 190, in get_sensor_data "image_idx": info["image"]["image_idx"], KeyError: 'image'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/yiqunhe/second.pytorch/second/pytorch/train.py", line 670, in fire.Fire() File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/fire/core.py", line 127, in Fire component_trace = _Fire(component, args, context, name) File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/fire/core.py", line 366, in _Fire it is info!!!!!!! component, remaining_args) File "/home/yiqunhe/.conda/envs/yiqunhe/lib/python3.7/site-packages/fire/core.py", line 542, in _CallCallable result = fn(*varargs, **kwargs) File "/home/yiqunhe/second.pytorch/second/pytorch/train.py", line 428, in train json.dumps(example["metadata"], indent=2) UnboundLocalError: local variable 'example' referenced before assignment

shaldor0315 avatar May 31 '19 02:05 shaldor0315

Have you solved this question? I get the same questions

tyjiang1997 avatar Sep 23 '19 12:09 tyjiang1997

I also get the same questions.

DGCHAO avatar May 12 '20 06:05 DGCHAO

same problem, any solution?

ConanCui avatar Aug 05 '20 12:08 ConanCui

I had the similar problem. I figured out that the kitti_infos_train.pkl file I was using was generated using a different version than this repo. To fix that, you can run python create_data.py kitti_data_prep --root_path=/path/to/KITTI/root/directory and generate new kitti_infos_train.pkl which will have the necessary keys for the dictionary to be read by the script.

niqbal996 avatar Aug 12 '21 10:08 niqbal996

@niqbal996 can you mention the version. I got the same error even though the versions were same

arsalan311 avatar Sep 01 '21 11:09 arsalan311