AIR-THU / DAIR-RCooper

[CVPR2024] Official implementation of "RCooper: A Real-world Large-scale Dataset for Roadside Cooperative Perception"
https://openaccess.thecvf.com/content/CVPR2024/html/Hao_RCooper_A_Real-world_Large-scale_Dataset_for_Roadside_Cooperative_Perception_CVPR_2024_paper.html
55 stars 5 forks source link

KeyError #7

Closed githigher closed 2 months ago

githigher commented 3 months ago

When I train ‘corridor’, the following errors occur:

Traceback (most recent call last):
  File "opencood_plugin/opencood/tools/train.py", line 210, in <module>
    main()
  File "opencood_plugin/opencood/tools/train.py", line 142, in main
    for i, batch_data in enumerate(train_loader):
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 681, in __next__
    data = self._next_data()
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1356, in _next_data
    return self._process_data(data)
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 1402, in _process_data
    data.reraise()
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/_utils.py", line 461, in reraise
    raise exception
KeyError: Caught KeyError in DataLoader worker process 7.
Original Traceback (most recent call last):
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/utils/data/_utils/worker.py", line 302, in _worker_loop
    data = fetcher.fetch(index)
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/coop/anaconda3/envs/v2xvit/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp>
    data = [self.dataset[idx] for idx in possibly_batched_index]
  File "/home/coop/gyt/DAIR-RCooper-main/codes/opencood_plugin/opencood/data_utils/datasets/intermediate_fusion_dataset.py", line 58, in __getitem__
    cur_ego_pose_flag=self.cur_ego_pose_flag)
  File "/home/coop/gyt/DAIR-RCooper-main/codes/opencood_plugin/opencood/data_utils/datasets/basedataset.py", line 236, in retrieve_base_data
    self.calc_dist_to_ego(scenario_database, timestamp_key)
  File "/home/coop/gyt/DAIR-RCooper-main/codes/opencood_plugin/opencood/data_utils/datasets/basedataset.py", line 335, in calc_dist_to_ego
    load_yaml(cav_content[timestamp_key]['yaml'])['lidar_pose']
KeyError: '00007'

Does this mean there are issues with my data preparation stage? Here is my dataset structure:

- dataset
  - data
    - corridor
     - train (173G)
     - val (19G)
    - intersection
  - label
    - 106-105
    - 116-115
    - 117-118-120-119
    - 136-137-138-139
    - infos
  - calib
    - lidar2cam
    - lidar2world

I noticed that the folders under ‘dataset/data/corridor/train’ seem to be discontinuous:

106-105_seq-000/  106-105_seq-037/  106-105_seq-072/  116-115_seq-036/  116-115_seq-067/  116-115_seq-105/  116-115_seq-139/
106-105_seq-002/  106-105_seq-038/  106-105_seq-073/  116-115_seq-037/  116-115_seq-068/  116-115_seq-106/  116-115_seq-142/
106-105_seq-003/  106-105_seq-039/  106-105_seq-074/  116-115_seq-038/  116-115_seq-071/  116-115_seq-108/  116-115_seq-143/
106-105_seq-004/  106-105_seq-041/  106-105_seq-105/  116-115_seq-039/  116-115_seq-072/  116-115_seq-109/  116-115_seq-144/
106-105_seq-005/  106-105_seq-042/  116-115_seq-000/  116-115_seq-040/  116-115_seq-073/  116-115_seq-110/  116-115_seq-145/
106-105_seq-007/  106-105_seq-043/  116-115_seq-002/  116-115_seq-041/  116-115_seq-074/  116-115_seq-111/  116-115_seq-146/
106-105_seq-008/  106-105_seq-045/  116-115_seq-004/  116-115_seq-042/  116-115_seq-076/  116-115_seq-112/  116-115_seq-147/
106-105_seq-010/  106-105_seq-046/  116-115_seq-005/  116-115_seq-043/  116-115_seq-077/  116-115_seq-113/  116-115_seq-148/
106-105_seq-011/  106-105_seq-047/  116-115_seq-006/  116-115_seq-044/  116-115_seq-078/  116-115_seq-114/  116-115_seq-149/
106-105_seq-012/  106-105_seq-048/  116-115_seq-007/  116-115_seq-046/  116-115_seq-079/  116-115_seq-115/  116-115_seq-150/
106-105_seq-013/  106-105_seq-049/  116-115_seq-009/  116-115_seq-047/  116-115_seq-080/  116-115_seq-116/  116-115_seq-151/
106-105_seq-014/  106-105_seq-050/  116-115_seq-010/  116-115_seq-048/  116-115_seq-081/  116-115_seq-119/  116-115_seq-152/
106-105_seq-015/  106-105_seq-052/  116-115_seq-013/  116-115_seq-049/  116-115_seq-082/  116-115_seq-120/  116-115_seq-153/
106-105_seq-016/  106-105_seq-053/  116-115_seq-014/  116-115_seq-050/  116-115_seq-085/  116-115_seq-121/  116-115_seq-154/
106-105_seq-017/  106-105_seq-054/  116-115_seq-015/  116-115_seq-051/  116-115_seq-086/  116-115_seq-122/  116-115_seq-156/
106-105_seq-018/  106-105_seq-055/  116-115_seq-016/  116-115_seq-052/  116-115_seq-087/  116-115_seq-123/  116-115_seq-157/
106-105_seq-019/  106-105_seq-057/  116-115_seq-018/  116-115_seq-053/  116-115_seq-088/  116-115_seq-125/  116-115_seq-158/
106-105_seq-021/  106-105_seq-058/  116-115_seq-019/  116-115_seq-054/  116-115_seq-090/  116-115_seq-126/  116-115_seq-160/
106-105_seq-023/  106-105_seq-059/  116-115_seq-021/  116-115_seq-055/  116-115_seq-092/  116-115_seq-127/  116-115_seq-161/
106-105_seq-024/  106-105_seq-060/  116-115_seq-022/  116-115_seq-056/  116-115_seq-093/  116-115_seq-128/  116-115_seq-162/
106-105_seq-025/  106-105_seq-061/  116-115_seq-024/  116-115_seq-057/  116-115_seq-094/  116-115_seq-129/  116-115_seq-163/
106-105_seq-026/  106-105_seq-062/  116-115_seq-025/  116-115_seq-058/  116-115_seq-095/  116-115_seq-131/  116-115_seq-164/
106-105_seq-028/  106-105_seq-063/  116-115_seq-027/  116-115_seq-059/  116-115_seq-097/  116-115_seq-132/  116-115_seq-167/
106-105_seq-029/  106-105_seq-064/  116-115_seq-029/  116-115_seq-060/  116-115_seq-098/  116-115_seq-133/  116-115_seq-168/
106-105_seq-030/  106-105_seq-066/  116-115_seq-030/  116-115_seq-062/  116-115_seq-099/  116-115_seq-134/  116-115_seq-169/
106-105_seq-032/  106-105_seq-067/  116-115_seq-032/  116-115_seq-063/  116-115_seq-100/  116-115_seq-135/
106-105_seq-034/  106-105_seq-069/  116-115_seq-033/  116-115_seq-064/  116-115_seq-102/  116-115_seq-136/
106-105_seq-035/  106-105_seq-070/  116-115_seq-034/  116-115_seq-065/  116-115_seq-103/  116-115_seq-137/
106-105_seq-036/  106-105_seq-071/  116-115_seq-035/  116-115_seq-066/  116-115_seq-104/  116-115_seq-138/

Is this normal?

githigher commented 3 months ago

But when I train intersection, I can successfully train. And I noticed that the train and val folders in the intersection are also discontinuous.

ryhnhao commented 2 months ago

Hi, @githigher According to our attempts, no similar issues were found. Maybe you can check whether the preprocess here (RCooper 2 opv2v) is correctly conducted or the data path.

githigher commented 2 months ago

Thank you very much for your reply. I noticed that there was a slight error in my previous configuration of the converter_config.py file. Specifically, I have set the data path and dst_path path to the same path. Later, I corrected the configuration information and converted RCooper to OPV2V again, as shown in the following figure. I succeeded this time. QQ图片20240407214756