fix: absolutize symlink target so relative --input-dataset does not produce a dangling videos link - #3
Open
memosr wants to merge 1 commit into
Open
fix: absolutize symlink target so relative --input-dataset does not produce a dangling videos link#3memosr wants to merge 1 commit into
memosr wants to merge 1 commit into
Conversation
A symlink target resolves relative to the link's own directory, not the process cwd. LeRobotV3Dataset.from_path does not resolve its input, so a relative --input-dataset produced a dangling videos symlink. The failure is silent: convert_dataset returns 0 and the report records resolved paths while the link points nowhere. Uses os.path.abspath rather than Path.resolve to avoid following symlinks inside the source path. No-op for absolute inputs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
copy_tree_or_symlinkwrites the source path into the symlink verbatim, so arelative
--input-datasetproduces a dangling link and the converted datasetends up with no readable videos.
axis_train/data/lerobot_v3.py:157:A symlink target is resolved relative to the directory containing the link, not
relative to the process working directory.
LeRobotV3Dataset.from_pathdoes notresolve the path (
lerobot_v3.py:20-21), sosrc.videos_dirstays exactly asthe caller typed it.
This is the default code path:
convert_action_9d_to_8d.py:26setssymlink_videos=not args.copy_videos.Why this is easy to miss
Nothing raises.
convert_datasetcompletes anddata/convert_action_9d_to_8d.py:33returns 0. Theinput_datasetandoutput_datasetfields written to the report are.resolve()d(
action_conversion.py:194-195), so the report looks correct while the symlinkpoints nowhere.
Fix
One line, plus the
osimport:os.path.abspathrather thanPath.resolve()on purpose:resolve()wouldalso follow symlinks inside the source path, which is a separate behaviour
change.
Verification
Ran
copy_tree_or_symlinkdirectly against a temporary dataset tree, before andafter:
videos/readable--input-dataset, beforeraw_ds/videosFileNotFoundError--input-dataset, after/…/raw_ds/videos['cam.mp4']--input-dataset, before/…/raw_ds/videos['cam.mp4']--input-dataset, after/…/raw_ds/videos['cam.mp4']The absolute case is unchanged, which is also the check that
resolve()is notin play: the target keeps its original
/var/…form instead of being rewrittento
/private/var/….The
symlink=Falsebranch is untouched.Scope
One file. No overlap with #1 (CI, tests,
pyproject.toml) or #2 (README.md,training/run_libero_eval.sh).Caveat
convert_action_9d_to_8d.pyis not referenced in the README or underdocs/,so I cannot claim a documented workflow is broken. The claim is narrower: anyone
invoking it with a relative path from the repo root gets a dataset whose videos
are unreachable, with no error.