Skip to content

Conversation

@louislelay
Copy link
Collaborator

While encountering the following error during training with --video:

ValueError: ('Render mode is None, which is incompatible with RecordVideo.', 
'Initialize your environment with a render_mode that returns an image, such as rgb_array.')

I corrected it by adding the same environment creation logic as in the play script, with a condition on the render_mode based on the video flag.

During this change, I noticed that the logs directory was being created at the same level as the train and play scripts. To stay consistent with Isaac Lab, I moved it to the root of the repository.

I also updated the way _HERE is created (see this explanation):

  • previously it could be absolute or relative depending on how the script was called
  • now it is always an absolute and normalized path using Path(__file__).resolve().parent

The same modifications were applied to the tracking play and train scripts, although I couldn’t test those as I don’t have a pretrained motion available

@louislelay louislelay requested a review from kevinzakka August 27, 2025 11:26
@louislelay
Copy link
Collaborator Author

Hey @kevinzakka, I’m running into a strange loop with the Ruff checks!

Locally everything looks clean after running Ruff + pre-commit:

$ uvx [email protected] check --fix .
All checks passed!

$ pre-commit run --all-files
ruff check...............................................................Passed
ruff format..............................................................Passed

But on the PR checks I consistently see errors like:

--- src/mjlab/tasks/tracking/rl/runner.py
+++ src/mjlab/tasks/tracking/rl/runner.py
@@ -1,9 +1,9 @@
 import os

+import wandb
 from rsl_rl.env.vec_env import VecEnv
 from rsl_rl.runners import OnPolicyRunner

-import wandb
 from mjlab.rl import RslRlVecEnvWrapper
...
Would fix 2 errors.
Error: Process completed with exit code 1.

So CI wants one import ordering, while pre-commit locally forces the opposite. When I try to commit what CI seems to want, the pre-commit hook refuses the commit and rewrites the file back:

$ git commit -m "formats to pass PR checks"
ruff check...............................................................Failed
- hook id: ruff-check
- files were modified by this hook

After staging those changes and committing again, locally everything passes, but CI then fails again with the other version.

Not sure if this is a config/version mismatch between pre-commit and CI, or something wrong in my PR itself. Maybe you already know what’s going on here and can point me in the right direction so I can get the PR checks to pass.

@kevinzakka
Copy link
Collaborator

@louislelay Delete the wandb directory in the src directory and it will fix the ruff issue :)

@louislelay
Copy link
Collaborator Author

Thank you @kevinzakka! 😆

kevinzakka added a commit that referenced this pull request Sep 2, 2025
@kevinzakka kevinzakka merged commit 2f74676 into main Sep 5, 2025
7 checks passed
@louislelay louislelay deleted the fix/record-training branch September 21, 2025 22:07
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.

3 participants