mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-24 21:19:53 +00:00
fix: episode index is asserted 0-based in lerobot dataset
This commit is contained in:
@@ -202,6 +202,12 @@ def convert_data(root: Path, new_root: Path, data_file_size_in_mb: int, task_ind
|
|||||||
size_in_mb += ep_size_in_mb
|
size_in_mb += ep_size_in_mb
|
||||||
num_frames += ep_num_frames
|
num_frames += ep_num_frames
|
||||||
episodes_metadata.append(ep_metadata)
|
episodes_metadata.append(ep_metadata)
|
||||||
|
|
||||||
|
# write 0-based episode index instead of custom episode index (otherwise breaks compatibility with LeRobotDataset)
|
||||||
|
tmp_df = pd.read_parquet(ep_path)
|
||||||
|
tmp_df["episode_index"] = ep_idx
|
||||||
|
tmp_df.to_parquet(ep_path)
|
||||||
|
|
||||||
ep_idx += 1
|
ep_idx += 1
|
||||||
|
|
||||||
if size_in_mb < data_file_size_in_mb:
|
if size_in_mb < data_file_size_in_mb:
|
||||||
|
|||||||
Reference in New Issue
Block a user