Questions tagged [stable-baselines]

Stable Baselines is a library with implementations of various reinforcement learning algorithms in Python, developed by OpenAI. Please mention the exact version of Stable Baselines that is being used in the body of the question.

277 questions
1
vote
0 answers

Could not Find TensorRT

I'm using stable_baseline3 for RL purpose, and during the installation of my setup I have installed both pytorch and tensorflow, the former before the other one. When I import a library that needed tensorflow, i got the following warning W…
Gpp22
  • 43
  • 1
  • 9
1
vote
1 answer

Using Stable-baselines3 with Gymnasium action space error

I was trying to use My gym environment with stable baselines, but when I had to update the stable-baselines3 version to 2.0.0a5 my environment did not work anyore, and after loking at several documentation and forum threads I saw I had to start…
pepito
  • 433
  • 1
  • 3
  • 15
1
vote
1 answer

PettingZoo Agent Training with Supersuit and Stable Baselines 3

I am trying to train agents in a PettingZoo environment using stable baselines and supersuit. The new version from stable baselines 3, which is beta, is supporting Gymnasium now, and not just Gym. Therefore it should be compatible. Still it looks…
1
vote
1 answer

Behavioural cloning (Imitation learning) for SB3-contrib RecurrentPPO

I'm working on a LSTM RecurrentPPO that's need a behavioural cloning implementation. The Imitation library provided with Stable Baselines 3 (see here : https://imitation.readthedocs.io/en/latest/) does not seem made for SB3-contrib's RecurrentPPO. I…
GerardL
  • 81
  • 7
1
vote
1 answer

In stable-Baselines3 PPO what is nsteps?

In the SB3 PPO algorithm, what does the n_steps refer to? Is this the number of steps to run the environment? If so, what if the environment terminates prior to reaching n_steps? and how does it relate to batch_size? I am running 12 environments…
Craig Evans
  • 73
  • 1
  • 9
1
vote
0 answers

stable-baselines3 loading a model error. what does ResourceWarning: unclosed file mean?

I am receiving an error when loading a model, which only appears in a custom environment. The model trains fine and I can predict after training. However, if I try to reload the model I receive the following error: ResourceWarning: unclosed file…
Craig Evans
  • 73
  • 1
  • 9
1
vote
1 answer

Masking Invalid Actions when using Stable Baselines

I am attempting to set up an environment for an RL problem using stable-baselines. Assume that the action space consists of several groups of actions as follows. Group 1: 30 actions Group 2: 30 actions Group 3: 100K actions Group 4: 30 actions In a…
1
vote
0 answers

How to schedule learning rate decay based on metrics for stable baselines 3?

I want to write a learning rate schedule based on logged metrics. The API's doc provides example for linear decaying (https://stable-baselines3.readthedocs.io/en/master/guide/examples.html#learning-rate-schedule) and examples can be found for…
GerardL
  • 81
  • 7
1
vote
0 answers

stable_baselines3 callback on each step

I am training a stable_baselines3 PPO agent and want to perform some task on every step. To do this, I'm using a callback CustomCallback with _on_step method defined. But it appears that _on_step is called only on every PPO.n_steps, so if n_steps…
1
vote
1 answer

Do I need to retrain reinforcement model from scratch each time I want to use it in practice?

This seems like it should be obvious but I can't find resources on it anywhere. I am building a reinforcement learning model with openai's gym any_trading environment and stablebaselines3. There are a ton of online tutorials and documentation for…
1
vote
0 answers

How to add metrics to EvalCallback in StableBaselines 3

I want to add some metrics like loss to evaluation metrics in Stable Baselines 3. The goal is to make an callback that stops training on loss no decreasing instead of provided OnNoImprovement stop callback. The reason is the model trains against…
GerardL
  • 81
  • 7
1
vote
0 answers

StableBaselines3 / steps vs. total_timesteps vs. number of times environment is solved during training

model.learn(total_timesteps=20) takes much longer than I expected, so I'm trying to understand if I should: Be frugal with time steps Speed up my environment env.step(action) Train even more time steps Consider a simple environment: There are…
user3533030
  • 359
  • 3
  • 17
1
vote
0 answers

Stable Baselines 3 DQN Model refuses to use CUDA even though it recognizes my GPU

as the title states. My DQN Model refuses to use the GPU for a custom environment with Stable Baselines 3. model = DQN("MlpPolicy", env, device="cuda") My GPU is an RTX 2070 Super Installed CUDA Version is 10.1 Installed cudNN Version is 7.5.0…
yuzuki
  • 11
  • 2
1
vote
1 answer

Get the current step number in a gym.Env

Is there a way to access the current step number of a gym.Env from inside its step method? I'm using a model from stable_baselines3 and want to terminate the env when N steps have been taken.
gameveloster
  • 901
  • 1
  • 6
  • 18
1
vote
0 answers

Can´t use Stable Baselines 3 in Anaconda Environment

I try to use Stable Baselines 3 in my project. Still I can't use it, even after installing it in my Anaconda environment. Python Script from stable_baselines3.common.env_checker import check_env from env.project_env import * env = ProjectEnv() # It…
Benito
  • 11
  • 1