YanjieZe / Improved-3D-Diffusion-Policy

[arXiv 2024] Generalizable Humanoid Manipulation with Improved 3D Diffusion Policies. Part 1: Train & Deploy of iDP3
MIT License
134 stars 12 forks source link

A Possible Fix for Path Resolution in `replay_buffer.py` #3

Closed Naming-isDifficult closed 1 month ago

Naming-isDifficult commented 1 month ago

Overview

This pull request introduces a possible fix to improve how paths are handled in the replay_buffer.py module. Currently, it seems that the code expects absolute paths (based on example bash scripts), which limits flexibility when working with relative paths in the provided bash scripts.

Problem

In the scripts under Improved-3D-Diffusion-Policy/scripts, the dataset_path variable is set as an absolute path. Using a relative path results in an error. Most likely it's caused by the misuse of os.path.expanduser in the replay_buffer.py file. (Though I'm not sure why...)

Solution

I’ve implemented a custom function, _get_absolute_zarr_path, to convert relative paths into absolute ones based on the repository’s root directory. This ensures that both relative and absolute paths can be used seamlessly, offering more flexibility for users.

P.S.

I did find this helpful but I'm not sure if _get_absolute_zarr_path behaved like what you would expect... However, I'd appreciate feedback on whether this solution aligns with your expectations.