DAIR-RCooper icon indicating copy to clipboard operation
DAIR-RCooper copied to clipboard

KeyError, data extraction issue.

Open abdelouareth-laghzaoui opened this issue 2 months ago • 2 comments

Hello, I am trying to execute an inference process using the intersection Cobevt model checkpoint. Here are the error logs :

Image

For context, I only use the sequence number 0 of the dataset, the conversion to OPV2V format was successful I think.

Any help or advice would be very precious :)

abdelouareth-laghzaoui avatar Oct 11 '25 09:10 abdelouareth-laghzaoui

Hi, @abdelouareth-laghzaoui The code was written assuming Linux-style paths (/). On Windows, the backslashes (\) end up in the timestamp key, breaking the dictionary lookup.

In Windows, Fix: In basedataset.py (around calc_dist_to_ego), replace: cur_lidar_pose = load_yaml(cav_content[timestamp_key]['yaml'])['lidar_pose'] with:

import os
ts_key = os.path.basename(str(timestamp_key))
cur_lidar_pose = load_yaml(cav_content[ts_key]['yaml'])['lidar_pose']

This ensures only the last part (the timestamp) is used as the key.

If possible, try running the inference on Linux or WSL, since OpenCOOD/OPV2V paths and scripts were primarily designed for POSIX systems.

ryhnhao avatar Oct 12 '25 12:10 ryhnhao

Hello @ryhnhao,

Thank you for your fast response. Here are the error logs after I applied the modification you suggested :

Image

Basically, since I use windows style paths the "scenario_database" dictionnary already contains full paths. The issue is that timestamp_key doesn't adapt to the cav id :

For example when cav_id is 1 the timestamp key should be : \DAIR-RCooper-main\RCooper_OPV2V\data\intersection\val\136-137-138-139_seq-000\1\00000' instead of \DAIR-RCooper-main\RCooper_OPV2V\data\intersection\val\136-137-138-139_seq-000\0\00000'

Is it possible to have "scenario_database" holding pure timestamps instead of full paths ?

Thank you in advance for your help.

abdelouareth-laghzaoui avatar Oct 13 '25 11:10 abdelouareth-laghzaoui