lerobot icon indicating copy to clipboard operation
lerobot copied to clipboard

[Fix] Fix the path resolve issue in windows

Open whats2000 opened this issue 1 month ago • 1 comments

Fix: Fix the path resolve issue in Windows

What this does

This PR fixes a path-resolution issue on Windows by ensuring that pretrained_path is kept as a string rather than converted to a Path object. Using Path() caused backslash/forward-slash inconsistencies, especially when handling HuggingFace repo IDs. The fix ensures consistent forward-slash formatting across platforms.

How it was tested

  • Updated eval.py and train.py to avoid using Path() for pretrained_path where forward-slash preservation is required.
  • Verified that Windows paths resolve correctly when loading configs.
  • Ran local training/eval runs on Windows to ensure no regressions during config loading.

How to checkout & try? (for the reviewer)

To test the behavior locally run a training command that loads a pretrained policy:

lerobot-train --config-path=path/to/config.yaml

whats2000 avatar Nov 19 '25 18:11 whats2000

This kinda because the path in the window will use the \\ for path; if we use the path object, this will always make the HuggingFace repo invalid to resolve. So a better way is that we keep them in posix style string to ensure all the paths create by train and resolve by train in posix style!

whats2000 avatar Nov 19 '25 18:11 whats2000

Ahhh I ran into this too. https://github.com/huggingface/lerobot/issues/2552

DanielBryars avatar Dec 01 '25 22:12 DanielBryars