Getting Started

How to get started with Stable Baselines3

1

Install Stable Baselines3

Run `pip install stable-baselines3` to install the library.

2

Create or Load Environment

Create a Gymnasium environment or load an existing one; VecEnv is used internally for vectorized environments.

3

Initialize Model

Initialize a model, for example: `model = PPO("MlpPolicy", env, verbose=1)`.

4

Train the Model

Train the model using `model.learn(total_timesteps=10000)`.

5

Save and Load Model

Save the trained model with `model.save("path")` and load it later using `model = PPO.load("path")`.