Skip to content

Conversation

@louislelay
Copy link
Collaborator

While trying to run this command uv run --extra rl scripts/velocity/rl/train.py --task Velocity-Flat-Unitree-Go1-v0, I ran into the following error:

spring@pal-springbasestation:~/mjlab$ uv run --extra rl scripts/velocity/rl/train.py --task Velocity-Flat-Unitree-Go1-v0
Traceback (most recent call last):
  File "/home/spring/mjlab/scripts/velocity/rl/train.py", line 104, in <module>
    tyro.cli(main)
    ~~~~~~~~^^^^^^
  File "/home/spring/mjlab/.venv/lib/python3.13/site-packages/tyro/_cli.py", line 230, in cli
    return run_with_args_from_cli()
  File "/home/spring/mjlab/scripts/velocity/rl/train.py", line 39, in main
    env_cfg = load_cfg_from_registry(task, "env_cfg_entry_point")
  File "/home/spring/mjlab/src/mjlab/third_party/isaaclab/isaaclab_tasks/utils/parse_cfg.py", line 54, in load_cfg_from_registry
    cfg_entry_point = gym.spec(task_name.split(":")[-1]).kwargs.get(entry_point_key)
                      ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/spring/mjlab/.venv/lib/python3.13/site-packages/gymnasium/envs/registration.py", line 1000, in spec
    _check_version_exists(ns, name, version)
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/home/spring/mjlab/.venv/lib/python3.13/site-packages/gymnasium/envs/registration.py", line 392, in _check_version_exists
    _check_name_exists(ns, name)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^
  File "/home/spring/mjlab/.venv/lib/python3.13/site-packages/gymnasium/envs/registration.py", line 369, in _check_name_exists
    raise error.NameNotFound(
        f"Environment `{name}` doesn't exist{namespace_msg}.{suggestion_msg}"
    )
gymnasium.error.NameNotFound: Environment `Velocity-Flat-Unitree-Go1` doesn't exist.

The issue was caused by mjlab.tasks not being imported, so I added it to both the RL play and train scripts. I think it may have been removed by pre-commit, so I added # noqa: F401 to ensure it is kept.

@louislelay louislelay changed the title Adds tasks pkg import for its side-effects Adds mjlab.tasks import for env registration Aug 25, 2025
@louislelay louislelay requested a review from kevinzakka August 25, 2025 12:03
Copy link
Collaborator

@kevinzakka kevinzakka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does not happen in the tracking train and play scripts because we import the config from the task and do type casting of the returned env_cfg: env_cfg = cast(TrackingEnvCfg, load_cfg_from_registry(task, "env_cfg_entry_point")). I have a local branch that cleans up the velocity task and I'll push it later today but when I do I believe this won't be necessary. Sound good to you?

PS: It's great to see you already contributing to mjlab!

@louislelay
Copy link
Collaborator Author

louislelay commented Aug 25, 2025

oh ok, it makes sense! Sounds good to me, I'll close it then!

And yes, I wanted to begin trying it out today I've a few other things in mind to add but that's really great work congrats!

@louislelay louislelay closed this Aug 25, 2025
@louislelay louislelay deleted the fix/task-not-registered branch August 28, 2025 10:04
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