IsaacLab Installation on Ubuntu 20.04, train a robot!

How Install IssacLab on unbuntu 20.04

Follow the official documentation
Installation using Isaac Sim Binaries

How to run the checkpoint (the policy you trained)

## train a new policy
./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task=Isaac-Velocity-Rough-Anymal-C-v0 --headless
## play the policy
./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/play.py --task=Isaac-Velocity-Rough-Anymal-C-v0 --num_envs 32 --checkpoint logs/rsl_rl/anymal_c_rough/2025-02-12_10-49-33/model_1499.pt

Train a robot KeyError solution

Error description


The output showed something:

Error executing job with overrides: []
Traceback (most recent call last):
  File "/home/gao/IsaacLab/source/isaaclab_tasks/isaaclab_tasks/utils/hydra.py", line 101, in hydra_main
    func(env_cfg, agent_cfg, *args, **kwargs)
  File "/home/gao/IsaacLab/scripts/reinforcement_learning/rsl_rl/train.py", line 129, in main
    runner = OnPolicyRunner(env, agent_cfg.to_dict(), log_dir=log_dir, device=agent_cfg.device)
  File "/home/gao/miniforge3/envs/env_isaaclab/lib/python3.10/site-packages/rsl_rl/runners/on_policy_runner.py", line 44, in __init__
    if self.alg_cfg["rnd_cfg"] is not None:
KeyError: 'rnd_cfg'

Set the environment variable HYDRA_FULL_ERROR=1 for a complete stack trace.
2025-02-12 08:51:32 [20,276ms] [Warning] [omni.fabric.plugin] gFabricState->gUsdStageToSimStageWithHistoryMap had 1 outstanding SimStageWithHistory(s) at shutdown
2025-02-12 08:51:32 [20,847ms] [Warning] [carb] Recursive unloadAllPlugins() detected!

how to solve

File 1 :/home/gao/miniforge3/envs/env_isaaclab/lib/python3.10/site-packages/rsl_rl/runners/on_policy_runner.py
(env_isaaclab) gao@rs-controlserver1:~/IsaacLab$ python -c "import rsl_rl.runners.on_policy_runner; print(rsl_rl.runners.on_policy_runner.__file__)"
/home/gao/miniforge3/envs/env_isaaclab/lib/python3.10/site-packages/rsl_rl/runners/on_policy_runner.py

Open the File for Editing:
For example, using code:

code /home/gao/miniforge3/envs/env_isaaclab/lib/python3.10/site-packages/rsl_rl/runners/on_policy_runner.py

Locate the Problematic Code:
Search (using Ctrl+F in code) for rnd_cfg. Look for a line similar to:

if self.alg_cfg["rnd_cfg"] is not None:

Modify the Code:
Change that line to:

if self.alg_cfg.get("rnd_cfg") is not None:

This uses the dictionary’s get method, which returns None (or a default value if you specify one) if the key is missing, thus avoiding the KeyError.

Save and Exit:

File 2 ./source/isaaclab_tasks/isaaclab_tasks/manager_based/locomotion/velocity/config/anymal_c/agents/rsl_rl_ppo_cfg.py

. Update the Configuration Schema
A more permanent solution is to ensure that the configuration schema includes “symmetry_cfg”. For example, if your configuration is defined in a dataclass (likely in a file like rsl_rl_ppo_cfg.py), add a default field for “symmetry_cfg”. For example:

from dataclasses import dataclass, field
from typing import Optional, Dict

@dataclass
class AnymalCRoughPPORunnerCfg(RslRlOnPolicyRunnerCfg):
    # ... other fields ...
    symmetry_cfg: Optional[Dict] = field(default_factory=dict)

Make sure you modify the version of the file that is actually being used (in your case, the one in the manager-based configuration if that’s what your logs indicate).

rerun the training command

./isaaclab.sh -p scripts/reinforcement_learning/rsl_rl/train.py --task=Isaac-Velocity-Rough-Anymal-C-v0 --headless

The output looks like this:

Actor MLP: Sequential(
  (0): Linear(in_features=235, out_features=512, bias=True)
  (1): ELU(alpha=1.0)
  (2): Linear(in_features=512, out_features=256, bias=True)
  (3): ELU(alpha=1.0)
  (4): Linear(in_features=256, out_features=128, bias=True)
  (5): ELU(alpha=1.0)
  (6): Linear(in_features=128, out_features=12, bias=True)
)
Critic MLP: Sequential(
  (0): Linear(in_features=235, out_features=512, bias=True)
  (1): ELU(alpha=1.0)
  (2): Linear(in_features=512, out_features=256, bias=True)
  (3): ELU(alpha=1.0)
  (4): Linear(in_features=256, out_features=128, bias=True)
  (5): ELU(alpha=1.0)
  (6): Linear(in_features=128, out_features=1, bias=True)
)
/home/gao/isaac-sim/isaac-sim-standalone@4.5.0/exts/omni.isaac.ml_archive/pip_prebundle/torch/nn/modules/module.py:1747: UserWarning: RNN module weights are not part of single contiguous chunk of memory. This means they need to be compacted at every call, possibly greatly increasing memory usage. To compact weights again call flatten_parameters(). (Triggered internally at ../aten/src/ATen/native/cudnn/RNN.cpp:1410.)
  return forward_call(*args, **kwargs)
################################################################################
                       Learning iteration 0/1500                        

                       Computation: 17687 steps/s (collection: 5.312s, learning 0.246s)
               Value function loss: 0.0365
                    Surrogate loss: 0.0010
             Mean action noise std: 1.00
                 Mean total reward: -0.35
               Mean episode length: 11.87
Episode_Reward/track_lin_vel_xy_exp: 0.0029
Episode_Reward/track_ang_vel_z_exp: 0.0020
       Episode_Reward/lin_vel_z_l2: -0.0098
      Episode_Reward/ang_vel_xy_l2: -0.0031
     Episode_Reward/dof_torques_l2: -0.0013
         Episode_Reward/dof_acc_l2: -0.0049
     Episode_Reward/action_rate_l2: -0.0028
      Episode_Reward/feet_air_time: -0.0003
 Episode_Reward/undesired_contacts: -0.0009
Episode_Reward/flat_orientation_l2: 0.0000
     Episode_Reward/dof_pos_limits: 0.0000
         Curriculum/terrain_levels: 3.5276
Metrics/base_velocity/error_vel_xy: 0.0173
Metrics/base_velocity/error_vel_yaw: 0.0172
      Episode_Termination/time_out: 3.5833
  Episode_Termination/base_contact: 0.0000
--------------------------------------------------------------------------------
                   Total timesteps: 98304
                    Iteration time: 5.56s
                        Total time: 5.56s
                               ETA: 8336.5s
                               Could not find git repository in /home/gao/miniforge3/envs/env_isaaclab/lib/python3.10/site-packages/rsl_rl/__init__.py. Skipping.
Storing git diff for 'IsaacLab' in: /home/gao/IsaacLab/logs/rsl_rl/anymal_c_rough/2025-02-12_10-49-33/git/IsaacLab.diff
/home/gao/isaac-sim/isaac-sim-standalone@4.5.0/exts/omni.isaac.ml_archive/pip_prebundle/torch/nn/modules/module.py:1747: UserWarning: RNN module weights are not part of single contiguous chunk of memory. This means they need to be compacted at every call, possibly greatly increasing memory usage. To compact weights again call flatten_parameters(). (Triggered internally at ../aten/src/ATen/native/cudnn/RNN.cpp:1410.)
  return forward_call(*args, **kwargs)
################################################################################
                       Learning iteration 1/1500                        

                       Computation: 25482 steps/s (collection: 3.705s, learning 0.152s)
               Value function loss: 0.0194
                    Surrogate loss: -0.0062
             Mean action noise std: 0.99
                 Mean total reward: -1.09
               Mean episode length: 39.25
Episode_Reward/track_lin_vel_xy_exp: 0.0075
Episode_Reward/track_ang_vel_z_exp: 0.0052
       Episode_Reward/lin_vel_z_l2: -0.0199
      Episode_Reward/ang_vel_xy_l2: -0.0094
     Episode_Reward/dof_torques_l2: -0.0043
         Episode_Reward/dof_acc_l2: -0.0143
     Episode_Reward/action_rate_l2: -0.0086
      Episode_Reward/feet_air_time: -0.0010
 Episode_Reward/undesired_contacts: -0.0051
Episode_Reward/flat_orientation_l2: 0.0000
     Episode_Reward/dof_pos_limits: 0.0000
         Curriculum/terrain_levels: 3.5047
Metrics/base_velocity/error_vel_xy: 0.0606
Metrics/base_velocity/error_vel_yaw: 0.0597
      Episode_Termination/time_out: 4.1250
  Episode_Termination/base_contact: 0.8750
--------------------------------------------------------------------------------
                   Total timesteps: 196608
                    Iteration time: 3.86s
                        Total time: 9.42s
                               ETA: 7056.9s

################################################################################
                       Learning iteration 2/1500                        

                       Computation: 23548 steps/s (collection: 4.017s, learning 0.158s)
               Value function loss: 0.0166
                    Surrogate loss: -0.0090
             Mean action noise std: 0.97
                 Mean total reward: -1.50
               Mean episode length: 63.07
Episode_Reward/track_lin_vel_xy_exp: 0.0118
Episode_Reward/track_ang_vel_z_exp: 0.0095
       Episode_Reward/lin_vel_z_l2: -0.0200
      Episode_Reward/ang_vel_xy_l2: -0.0145
     Episode_Reward/dof_torques_l2: -0.0075
         Episode_Reward/dof_acc_l2: -0.0231
     Episode_Reward/action_rate_l2: -0.0144
      Episode_Reward/feet_air_time: -0.0019
 Episode_Reward/undesired_contacts: -0.0138
Episode_Reward/flat_orientation_l2: 0.0000
     Episode_Reward/dof_pos_limits: 0.0000
         Curriculum/terrain_levels: 3.4744
Metrics/base_velocity/error_vel_xy: 0.0981
Metrics/base_velocity/error_vel_yaw: 0.0947
      Episode_Termination/time_out: 4.1250
  Episode_Termination/base_contact: 1.2500
--------------------------------------------------------------------------------
                   Total timesteps: 294912
                    Iteration time: 4.17s
                        Total time: 13.59s
                               ETA: 6785.9s

                               

### IsaacLab Installation Guide for Ubuntu 20.04 For installing IsaacLab on an Ubuntu 20.04 system, a series of preparatory steps must be completed to ensure compatibility and functionality. #### Preparing the System Environment Ensure that all necessary software is installed as described in tutorials covering essential installations for Ubuntu 20.04[^2]. This includes setting up the correct time zone, configuring input methods such as Sogou Pinyin, deploying Anaconda for Python development environments, using Terminator terminal emulator, ensuring Nvidia drivers are properly set up which is crucial since IsaacLab relies heavily on GPU acceleration capabilities provided by Nvidia hardware. #### Installing CUDA Toolkit Since IsaacLab requires CUDA support, follow guidelines similar to those outlined for WSL 2 but adapted specifically for native Linux distributions like Ubuntu 20.04[^4]. Install the appropriate version of the CUDA toolkit compatible with your graphics card model through either package managers or direct downloads from Nvidia's official website. ```bash sudo apt-get update && sudo apt-get install cuda ``` After installation completes successfully, verify it works correctly: ```bash nvcc --version ``` #### Setting Up cuDNN Following successful setup of CUDA, proceed to configure cuDNN according to instructions found within documentation related to Autoware environment configuration under Ubuntu 20.04[^3]: Download `libcudnn8` and its developer library corresponding to the chosen CUDA version before executing commands below: ```bash sudo dpkg -i libcudnn8_*.deb sudo dpkg -i libcudnn8-dev_*.deb ``` Confirm proper integration via running tests included inside sample directories bundled alongside cuDNN packages. #### Obtaining and Configuring IsaacLab Once prerequisites have been met, obtain access rights to download IsaacSim/IsaacLab SDK directly from Nvidia’s developer portal after registering there first if not done already. Follow detailed guides available online regarding unpacking archives, placing files into designated locations while adhering closely to any specific requirements mentioned during this process concerning dependencies management tools used throughout projects built around Omniverse platform components including IsaacLab itself. Finally, customize settings based upon personal preferences or project needs following post-installation procedures recommended officially by developers behind these applications. --related questions-- 1. What versions of CUDA should one choose when preparing their machine learning workstation? 2. How does adjusting system locale affect non-English speaking users' experiences on fresh installs of Ubuntu-based systems? 3. Can you explain how to troubleshoot common issues encountered after updating Nvidia drivers on Linux machines? 4. In what ways can integrating Jupyter notebooks enhance productivity within data science workflows conducted over Conda-managed virtual environments? 5. Are there alternative text editors besides Vim/GNU Emacs suitable for beginners who wish to write scripts efficiently without steep learning curves?
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值