Skip to content

Fix the documented workflows on a clean checkout - #17

Open
rakhimovv wants to merge 4 commits into
LeCAR-Lab:mainfrom
rakhimovv:runnable-from-clean-checkout
Open

Fix the documented workflows on a clean checkout#17
rakhimovv wants to merge 4 commits into
LeCAR-Lab:mainfrom
rakhimovv:runnable-from-clean-checkout

Conversation

@rakhimovv

Copy link
Copy Markdown

Hi — thank you for releasing HDMI, the motion data and configs have been genuinely useful to work with.

While setting it up from a fresh clone I hit a few things that stopped the commands in the README from running, and thought the fixes might be worth sharing. Each one is scoped to a documented workflow:

  • train.py with wandb.mode=disabled fails with FileNotFoundError: .../files/cfg.yaml — wandb reports a run.dir it doesn't create in disabled mode. In offline mode run.name is None, so run.name.split("-") raises. cfg/train.yaml suggests disabled for local debugging, so this path seems intended.
  • play.py export_policy=true fails for every ppo_roa variant — onnxscript 0.3.0's version converter rejects graphs containing functions, which torch routes through unconditionally.
  • Two task configs don't load: tracking/dance.yaml inherits base/tracking-base-wbt, which isn't in the tree, and tracking/carry_and_place_bread_box.yaml points at a clip whose shipped directory is the -0829 take.
  • Both scripts/vis commands fail on a clean install — pyzmq and sshkeyboard aren't declared — and the publisher expects motion.npz while the README and its --help both say to pass the folder.

Verified against 32282f6: train.py --wandb.mode=disabled goes rc=1 → rc=0 (500/500 iterations), and task configs 15/17 → 17/17.

Happy to split this into separate PRs, drop anything you'd rather handle differently, or close it if it overlaps work you already have in flight.

Add scripts/__init__.py so "from scripts.helpers import ..." resolves. With
setuptools >= 64 an editable install maps only declared packages, so the repo
root never reaches sys.path and every documented "python scripts/*.py" command
failed with ModuleNotFoundError: No module named 'scripts.helpers'.

train.py and train_sequential.py call wandb.init() without name=, so run.name is
None in offline mode and both crashed on run.name.split("-"). Fall back to the
run id. In disabled mode wandb reports a run.dir it never creates, so writing
cfg.yaml into it raised FileNotFoundError before the env was built; create the
directory first.

Hoist RefJointPos/DummyRefJointPos to module level in ppo_roa and ppo_amp.
Defined inside __init__ they are unpicklable, so export_policy=true died in
torch.save with "Can't pickle local object".

(cherry picked from commit 717ea651b8eb12cddda0efa8a05f1acfbe76db98)
onnxscript 0.3.0's version converter refuses graphs containing functions
(_ConvertVersionPassRequiresInline), which torch routes through unconditionally,
so export_policy=true failed for every ppo_roa variant even after torch.save was
fixed. Bump the pin to 0.7.1, which handles them.

Replace the deprecated torch.onnx.dynamo_export with torch.onnx.export(dynamo=True),
its supported successor since torch 2.6. Pass optimize=False: the optimizer renames
trailing-underscore graph inputs (ref_joint_pos_ -> ref_joint_pos__orig), which
breaks feeding the exported model by name, since export_onnx writes in_keys into
the sidecar metadata.

Verified end to end on both the teacher (ppo_roa_train) and student
(ppo_roa_finetune) paths: .pt, .onnx and .json are written and onnxruntime loads
the graph with inputs named exactly as in_keys.

(cherry picked from commit 1e3074f5d2ddd436755d18429922e55cab297428)
cfg/task/G1/tracking/carry_and_place_bread_box.yaml pointed data_path at
data/motion/data_for_sim/carry_and_place_bread_box, which is not in the release;
the shipped clip is the -0829 take the hdmi variant of the same task already
uses. It failed with "Matched 0 motion paths".

cfg/task/G1/tracking/dance.yaml inherited base/tracking-base-wbt, which does not
exist, so the config would not compose at all.

Remove cfg/algo/hier.yaml. It is an empty file (a single newline) referenced
nowhere, so algo=hier produced an InterpolationKeyError on hydra.run.dir instead
of a usable config. Without it Hydra reports the name as unknown and lists the
valid options.

Drop the ConfigStore registration of "critics" under group=algo. Critics is not a
policy class, so algo=critics could only ever fail with "Critics.__init__() got an
unexpected keyword argument 'env'".

All 17 task configs now replay.

(cherry picked from commit d73828c8ad6d7ca8c348d7797a1e98e470127889)
scripts/vis/motion_data_publisher.py took the motion.npz file, while the README
and its own --help both say to pass the motion folder; passing the documented
form raised IsADirectoryError. Accept either. Its cleanup() also assumed a fully
constructed publisher, so __del__ masked any error from __init__ behind
"AttributeError: no attribute 'joint_publisher'".

pyzmq and sshkeyboard are imported by scripts/vis but were not declared, so both
documented visualization commands failed on a clean install:

  scripts/vis/common.py:7                  import zmq                -> pyzmq
  scripts/vis/motion_data_publisher.py:25  from sshkeyboard import.. -> sshkeyboard

common.py is imported by both entry points, so neither could start.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant