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.
Questions tagged [stable-baselines]
277 questions
2
votes
0 answers
I need to install tensorflow 1.x and the code works until last week on google colab. Now it does not work
I need to install TensorFlow 1.x for solving my problem. When I run the below codes a week back on google colab (python version 3.8). It installed successfully, and since then I haven't changed anything on my code. However, now, when I run the same…

monir zaman
- 309
- 1
- 3
- 13
2
votes
0 answers
stable Baselines 3 model.predict with stepwise varying actions
I would like to train a gym model based on a custom environment.
The training loop looks like this:
obs = env.reset()
for i in range(1000):
action, _states = model.predict(obs, deterministic=True)
print(f"action: {action}")
…

Mike75
- 504
- 3
- 18
2
votes
1 answer
Hyperparameter Tuning with Wandb Sweep for custom parameters
I'm trying to tune the hyperparameters using the Stable-Baseline-3 Library for the network architecture.
My configuration file is:
program: main.py
method: bayes
name: sweep
metric:
goal: minimize
name: train/loss
parameters:
batch_size:
…

Marcelo Ruiz
- 373
- 3
- 14
2
votes
0 answers
Stable-baselines3 vs. Tianshou
What would you recommend between Stable-Baselines3 and Tianshou for applied research in Reinforcement Learning?
Can anyone provide a comparison of the strengths and weaknesses of each library?

SuperTardigrade
- 73
- 6
2
votes
3 answers
stable-baselines3 PPO model loaded but not working
I am trying to make an AI agent for playing OpenAI Gym CarRacing environment and I am having trouble loading saved models. I train them, they work, I save them and load them and suddenly the car doesn't even move. I even tried downloading models…

brownie
- 121
- 9
2
votes
0 answers
stable baselines imitation learning: how to create and train trajectories?
This question relates to a previous question about
imitation learning:
train stable baselines 3 with examples?
I want to create an very simple venv and/or policy to simulate the expert behavior.
Specifically I want to create an expert directly…

Mike75
- 504
- 3
- 18
2
votes
2 answers
How to train an RL agent in a custom environment?
I have created a custom space, which extends the OpenAI gym.Space. I need this space because I need an action space that sums up to a value. Using this, I can scale up the output and meet my requirement.
class ProbabilityBox(Space):
"""
…

Kranthi S
- 125
- 1
- 5
2
votes
1 answer
How to export trained stable-baselines/TensorFlow neural network to MATLAB?
I'm trying to export a PPO2-trained neural network to MATLAB. It was saved as a zip file using
model.save(os.path.join(save_dir, 'best_overall_model'))
I can load my model with
model = PPO2.load(os.path.join(load_dir), env=env,…

gilianzz
- 199
- 2
- 14
2
votes
1 answer
unabel to load a ppo model
hello I've trained a PPO model from stabel_baselines3 on collab I saved it
model.save("model")
but when I tried loading it I got the following error:
m = PPO.load("model", env=env)
AttributeError Traceback (most recent…

abdelmoumen
- 33
- 4
2
votes
1 answer
train stable baselines 3 with examples?
For my basic evaulation of learning algorithms
I defined a custom environment.
Now with standard examples for stable baselines the learning
seems always to be initiated by stable baselines automatically
(by stablebaselines choosing random actions…

Mike75
- 504
- 3
- 18
2
votes
0 answers
What is the correct observation shape for a 15x15 np array in a openai gym environment?
I am creating a gym enviroment which has a observation of just a 15x15 grid. The grid is filled initially with 0s, and as the game progresses the contents change to between 0 and 255. There are 225 possible actions, each of which corresponding to a…

Mercury
- 298
- 1
- 11
2
votes
1 answer
ValueError: At least one stride in the given numpy array is negative, and tensors with negative strides are not currently supported
I am writing the code for Autonomous Driving using RL. I am using a stable baseline3 and an open ai gym environment. I was running the following code in the jupyter notebook and it is giving me the following error:
# Testing our model
episodes = 5 #…

Shaina Mehta
- 120
- 1
- 9
2
votes
1 answer
Why does ep_rew_mean decrease over time?
In order to learn about reinforcement learning for optimization I have written some code to try to find the maximum cardinality matching in a graph. Not only does it not work well, when I set it so that done = True after 1000 steps, ep_rew_mean…

byteful
- 309
- 1
- 8
2
votes
0 answers
AttributeError: 'Box' object has no attribute 'shape' in Colab
I tired to load a model using stable-baselines3 in colab use the following code:
!pip install stable-baselines3[extra]
from stable_baselines3 import DQN
from stable_baselines3.common.vec_env import DummyVecEnv
MODEL_PATH =…

DAOMING CHEN
- 21
- 2
2
votes
1 answer
Rollout summary statistics not being monitored for CustomEnv using Stable-Baselines3
I am trying to train a custom environment using PPO via Stable-Baselines3 and OpenAI Gym. For some reason the rollout statistics are not being reported for this custom environment when I try to train the PPO model.
The code that I am using is below…

Alex Hill
- 41
- 3