Skip to content

踩坑GitHub Physical-Intelligence/openpi11 天前

convert_libero_data_to_lerobot内存泄漏致OOM,需重置hf_datas。 ​

本文由 AI 根据公开内容整理,可能有误,请以原文为准:convert_libero_data_to_lerobot.py uses a lot of memory.(GitHub Physical-Intelligence/openpi #829)

状态:有绕过办法

问题 ​

运行convert_libero_data_to_lerobot.py转换数据集时内存占用过高,每处理一个episode RSS增加约150MB直至OOM。根因是LeRobotDataset.save_episode调用_save_episode_table时通过concatenate_datasets将新episode拼接到`self.

环境 ​

lerobot@0cf8648, torch 2.7.1, datasets 3.6.0, pyarrow 20.0.0; macOS arm64 CPU验证环境

解决办法 ​

  1. 修改examples/libero/convert_libero_data_to_lerobot.py第91-97行,在每个dataset.save_episode()调用后立即执行dataset.hf_dataset = dataset.create_hf_dataset()以重置内存表,阻断concatenate_datasets对历史数据的重复拼接。
  2. 添加回归测试scripts/convert_libero_data_to_lerobot_test.py,使用4 episodes×4 frames的伪RLDS数据集驱动main()函数,断言内存表在跨episode时保持为空且磁盘parquet输出可完整round-trip。
  3. 转换完成后建议使用lerobot-doctor check工具验证生成数据集的episode完整性、索引连续性及视频文件完整性,防止因中断或修改导致数据损坏。

讨论原作者:@iwantlatiao 等,版权归原作者所有。

来源

本页事实对应的公开页面,以原文为准。

  1. GitHub Physical-Intelligence/openpi #829:`convert_libero_data_to_lerobot.py` uses a lot of memory.访问 2026-10-26