Running

July 21, 2025 ยท View on GitHub

First, cd ./legged_gym.

Note: all the commands and file paths below are relative to this <YOUR_RANDOM_PATH>/SkillBlender/legged_gym/ folder.

Training

python legged_gym/scripts/train.py --task <task_name> --wandb <wandb_name> --run_name <run_name> --headless --sim_device cuda:<i> --rl_device cuda:<i> # for resume, add --resume --load_run <run_name> [Optional: --resume_stop_at_max]

Parameters:

  • --task: refers to the environment name in legged_gym/envs/, and it can refer to both our low-level skill (w/o _task_ in env name, e.g. h1_walking) and high-level task (w/ _task_ in env name, e.g. h1_task_button).
  • --wandb: refers to the name of the wandb project, e.g. skillblender_h1. You might also need to add a default value to the --entity argument in legged_gym/utils/helpers.py if you want to use your own wandb account.
  • --run_name: refers to the name of the run, e.g. 0001_test. This is used to save the ckpt and log files.
  • --headless: run in headless mode (no GUI).
  • --sim_device: the device to run the simulation, e.g. cuda:0.
  • --rl_device: the device to run the RL training, e.g. cuda:0.
  • --resume: resume training from the last ckpt.
  • --load_run: the name of the run to load from for resuming, e.g. 0001_test.
  • --resume_stop_at_max: if set, the training will stop at the maximum number of steps (max_iterations) specified in the config file (e.g. legged_gym/envs/h1/h1_walking/h1_walking_config.py).

Note: if you want to train a high-level task using our method, please make sure that you have already acquired the low-level skills and their checkpoints are in ./logs/.

Playing

python legged_gym/scripts/play.py --task <task_name> --experiment_name <experiment_name> --load_run <run_name> --checkpoint -1 --sim_device cuda:<i> --rl_device cuda:<i> --visualize

Here the --experiment_name parameter refers to the one specified in the config file (e.g. legged_gym/envs/h1/h1_walking/h1_walking_config.py). By default it is set the same as the --task parameter, but you can change it to any other name as long as it matches the config file.

We also provide our pretrained checkpoints for low-level primitive skills and high-level tasks in Google Drive and Hugging Face (you can choose either of them). Please download and dump all the folders with env name (e.g. h1_walking, h1_2_task_button, etc.) into ./logs/. Then you can use the --load_run parameter to load the ckpt, e.g. --load_run 0000_best.

Note: in our released checkpoints for high-level tasks, 0000_best denotes our SkillBlender, while 1000_ppo denotes vanilla PPO for reference.

Evaluation

First edit legged_gym/scripts/run_evaluation.py to set robots, tasks, ckpts, etc. that you want to evaluate. Then run:

python legged_gym/scripts/run_evaluation.py

Note: the actual rollouts (set by total_rollouts in legged_gym/scripts/evaluate.py) will be less than the number in the progress bar (this is to make sure sufficient rollouts are done for each task), so don't worry if the progress bar is much longer than you expect!

Troubleshooting

  1. ImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory

    sudo cp <PATH_TO_YOUR_CONDA>/envs/human/lib/libpython3.8.so.1.0 /usr/lib/
    

    Reference: https://stackoverflow.com/questions/73582092/importerror-libpython3-8-so-1-0-cannot-open-shared-object-file-no-such-file-o

  2. [Error] [carb] [Plugin: libcarb.windowing-glfw.plugin.so] Could not load the dynamic library from /root/isaacgym/python/isaacgym/_bindings/linux-x86_64/libcarb.windowing-glfw.plugin.so. Error: libX11.so.6: cannot open shared object file: No such file or directory

    sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget -y
    

    Reference: https://stackoverflow.com/questions/69340703/error-while-loading-shared-libraries-libx11-so-6

  3. Segmentation fault (core dumped) for no reason

    sudo apt-get install ubuntu-desktop
    

    Reference: https://github.com/isaac-sim/IsaacGymEnvs/issues/52#issuecomment-1175822097

  4. subprocess.CalledProcessError: Command '['which', 'c++']' returned non-zero exit status 1.

    sudo apt install g++
    
  5. [Error] [carb] Failed to acquire interface: [carb::settings::ISettings v0.4], by client: carb.gym.python.gym_38 (plugin name: (null))

    cd <PATH_TO_YOUR_ISAACGYM>/python/isaacgym/_bindings/linux-x86_64/
    chmod ug+rwx *
    

    Reference: https://forums.developer.nvidia.com/t/couldnt-acquire-idictionary-interface-on-startup-to-collect-the-settings/273497