Skip to content
Back to skills

Stable Baselines3

ASecurity

"Use Stable-Baselines3 for PyTorch reinforcement learning: train

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
code-qualitypythongobashdockerdebuggingapi

Works with

  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill stable-baselines3 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Stable Baselines3?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Stable Baselines3
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-stable-baselines3/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-stable-baselines3)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: stable-baselines3
description: "Use Stable-Baselines3 for PyTorch reinforcement learning: train
  algorithms, validate Gymnasium environments, vectorize envs, customize
  policies, evaluate callbacks, and save/load SB3 models."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# Stable-Baselines3

Use this skill when a task involves Stable-Baselines3 (SB3), the PyTorch reinforcement-learning library with sklearn-like RL algorithms for Gymnasium environments.

## Install and Import Check

Stable-Baselines3 requires Python 3.10+ and PyTorch. For normal use:

```bash
pip install stable-baselines3
python - <<'PY'
import stable_baselines3 as sb3
print(sb3.__version__)
print(sb3.__all__)
PY
```

Use `pip install 'stable-baselines3[extra]'` only when the task needs optional rendering, TensorBoard/progress bars, Atari, plotting, or result-loading extras.

For a quick public API diagnostic, run [`scripts/sb3_doctor.py`](scripts/sb3_doctor.py) with `--help` first.

## Route by Task

- **Choose or train an algorithm**: use [`training-and-algorithms`](sub-skills/training-and-algorithms/SKILL.md) for A2C/PPO/DQN/SAC/TD3/DDPG selection, constructor parameters, `learn()`, action-space compatibility, and tiny smoke training.
- **Build, validate, or vectorize environments**: use [`environments-and-vectorization`](sub-skills/environments-and-vectorization/SKILL.md) for Gymnasium custom env APIs, `check_env`, `make_vec_env`, `DummyVecEnv`, `SubprocVecEnv`, `Monitor`, `VecNormalize`, and VecEnv API differences.
- **Evaluate, log, checkpoint, or load models**: use [`evaluation-and-persistence`](sub-skills/evaluation-and-persistence/SKILL.md) for `evaluate_policy`, callbacks, TensorBoard/logger behavior, `save()`, `load()`, replay buffers, `VecNormalize`, and portability debugging.
- **Customize policies and exploration**: use [`policies-and-customization`](sub-skills/policies-and-customization/SKILL.md) for `policy_kwargs`, custom feature extractors, `MultiInputPolicy`, action noise, gSDE, and `HerReplayBuffer`.

## Common Starting Points

- For a first CartPole-style training script, route to `training-and-algorithms` and use its `scripts/train_smoke.py` as a safe pattern.
- For custom Gymnasium env failures, route to `environments-and-vectorization` before changing the RL algorithm.
- For model portability or pickle/load errors, route to `evaluation-and-persistence` and use `print_system_info=True` guidance.
- For Dict observations, first validate spaces in `environments-and-vectorization`, then design `MultiInputPolicy` details in `policies-and-customization`.

## Shared References

- Read [`references/troubleshooting.md`](references/troubleshooting.md) for cross-cutting install/import, optional dependency, CPU/GPU, render, TensorBoard, and Gymnasium compatibility issues.
- Read [`references/native-verification.md`](references/native-verification.md) when selecting safe native SB3 tests or understanding which original repo behaviors informed this skill.
- Read [`references/repo-provenance.md`](references/repo-provenance.md) before deciding whether this skill matches a current Stable-Baselines3 checkout or needs refresh.

## Boundaries

This is a runtime user skill, not a maintainer release guide. It does not cover Docker image building, CI workflows, website generation, release publishing, or long benchmark training. If a task requires SB3 Contrib, RL Baselines3 Zoo, or SBX, treat those as adjacent projects and do not assume their APIs are included here.

Files in this skill

  • SKILL.md3.5 KB
  • references/native-verification.md1.7 KB
  • references/repo-provenance.md1.7 KB
  • references/repo-routing-metadata.json533 B
  • references/troubleshooting.md2.3 KB
  • scripts/sb3_doctor.py2.5 KB
  • sub-skills/environments-and-vectorization/SKILL.md2.5 KB
  • sub-skills/environments-and-vectorization/references/api-reference.md3.9 KB
  • sub-skills/environments-and-vectorization/references/custom-envs.md4.9 KB
  • sub-skills/environments-and-vectorization/references/troubleshooting.md5.9 KB
  • sub-skills/environments-and-vectorization/references/vectorized-envs.md5.9 KB
  • sub-skills/environments-and-vectorization/scripts/check_custom_env.py3.1 KB
  • sub-skills/evaluation-and-persistence/SKILL.md1.8 KB
  • sub-skills/evaluation-and-persistence/references/api-reference.md3.8 KB
  • sub-skills/evaluation-and-persistence/references/evaluation-and-callbacks.md6.4 KB
  • sub-skills/evaluation-and-persistence/references/logging.md4 KB
  • sub-skills/evaluation-and-persistence/references/save-load.md6 KB
  • sub-skills/evaluation-and-persistence/references/troubleshooting.md5.3 KB
  • sub-skills/evaluation-and-persistence/scripts/evaluate_saved_model.py3.9 KB
  • sub-skills/policies-and-customization/SKILL.md2.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.