{"id":22325,"library":"rsl-rl-lib","title":"RSL RL Lib","description":"Fast and simple reinforcement learning algorithms (PPO) implemented in PyTorch, primarily designed for robotics applications like Isaac Lab. Current version 5.2.0, released April 2025. Active development with frequent releases.","status":"active","version":"5.2.0","language":"python","source_language":"en","source_url":"https://github.com/leggedrobotics/rsl_rl","tags":["reinforcement-learning","ppo","pytorch","robotics","isaac-lab"],"install":[{"cmd":"pip install rsl-rl-lib","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core dependency for neural networks and tensor operations","package":"torch","optional":false}],"imports":[{"note":"Module is 'runners' (plural) since v5.0.0","wrong":"from rsl_rl.runner import OnPolicyRunner","symbol":"Runner","correct":"from rsl_rl.runners import OnPolicyRunner"},{"note":"Module is 'algorithms' (not 'algos') since v5.0.0","wrong":"from rsl_rl.algos import PPO","symbol":"PPO","correct":"from rsl_rl.algorithms import PPO"},{"note":"Direct import; no common wrong import known","symbol":"ActorCritic","correct":"from rsl_rl.models import ActorCritic"}],"quickstart":{"code":"import gym\nimport torch\nfrom rsl_rl.runners import OnPolicyRunner\nfrom rsl_rl.algorithms import PPO\nfrom rsl_rl.modules import ActorCritic\n\n# Initialize environment (example using gym)\nenv = gym.make('CartPole-v1')\n\n# Setup model and algorithm\nactor_critic = ActorCritic(\n    num_actor_obs=env.observation_space.shape[0],\n    num_critic_obs=env.observation_space.shape[0],\n    num_actions=env.action_space.shape[0],\n).to('cuda')\nalgo = PPO(actor_critic=actor_critic, num_learning_epochs=5)\n\n# Create runner and train\nrunner = OnPolicyRunner(env, algo, device='cuda')\nrunner.learn(num_learning_iterations=100, init_at_random_ep_len=True)\nprint('Training complete!')","lang":"python","description":"Basic training loop using OnPolicyRunner"},"warnings":[{"fix":"Update imports to new structure: from rsl_rl.runners import OnPolicyRunner; from rsl_rl.algorithms import PPO; from rsl_rl.models import ActorCritic","message":"v5.0.0 restructured library: modules 'runners' (not 'runner'), 'algorithms' (not 'algos'), 'models' (was 'actor_critic'). Old imports break.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use named arguments (e.g., obs=, actions=) instead of positional when calling RolloutStorage methods.","message":"v5.0.0 introduced Batch class; positional argument order in RolloutStorage changed. Incorrect ordering can cause silent tensor switching.","severity":"breaking","affected_versions":">=5.0.0"},{"fix":"Use config dict with keys 'algorithm' and 'runner' as shown in docs.","message":"v5.0.0 deprecates old configuration format. The new config uses nested dicts instead of flat parameters for algorithm and runner settings.","severity":"deprecated","affected_versions":">=5.0.0"},{"fix":"Disable compile for simple models: set model.cuda() and skip compile.","message":"torch.compile mode 'default' may slow down training for small MLP networks; only beneficial for large CNNs.","severity":"gotcha","affected_versions":">=5.1.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use import 'from rsl_rl.runners import OnPolicyRunner'","cause":"Module renamed from 'runner' to 'runners' in v5.0.0.","error":"ModuleNotFoundError: No module named 'rsl_rl.runner'"},{"fix":"Use 'from rsl_rl.algorithms import PPO'","cause":"Old import path for PPO algorithm.","error":"AttributeError: module 'rsl_rl' has no attribute 'algorithms'"},{"fix":"Ensure num_actor_obs, num_critic_obs, num_actions match the environment's observation and action spaces.","cause":"Mismatch between environment observation/action spaces and ActorCritic dimensions.","error":"ValueError: The number of observations and actions do not match"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}