openai-gym

Attribute error in PPO algorithm for Cartpole gym environment

Attribute error in PPO algorithm for Cartpole gym environment Question: I’m trying to run the code from here (Github link on this page): https://keras.io/examples/rl/ppo_cartpole/ I’m getting an attribute error in the training section from observation = observation.reshape(1,-1) which says "’tuple’ object has no attribute ‘reshape’". It seems that observation is currently env.reset() which is a …

Total answers: 1

Problem getting DQN to learn CartPole-v1 (PyTorch)

Problem getting DQN to learn CartPole-v1 (PyTorch) Question: So I had my DQN training fine, solves the environment after ~65_000 iterations. However, I started working on something else and now it’s completely broken and won’t get to even close to the same level anymore. Following advice from previous work, I tuned hyperparameters and still didn’t …

Total answers: 1

StableBaselines creating a model segmentation fault

StableBaselines creating a model segmentation fault Question: I am getting a segmentation fault when trying to create a stable_baselines3 PPO model on a CartPole-v1 OpenAI Gym environment. So far what I’ve tried is running a short example code on Python 3.10 as well as Python 3.9. I’m running the python script in a Conda environment. …

Total answers: 1

gym_super_mario_bros (7.3.0) – ValueError: not enough values to unpack (expected 5, got 4)

gym_super_mario_bros (7.3.0) – ValueError: not enough values to unpack (expected 5, got 4) Question: I’m running Python3 (3.8.10) and am attempting a tutorial with the gym_super_mario_bros (7.3.0) and nes_py libraries. I followed various tutorials code and tried on multiple computers but get an error. I have tried to adjust some of the parameters like adding …

Total answers: 2

How to take two arrays as output from Gym.Env to fit to DQN NN

How to take two arrays as output from Gym.Env to fit to DQN NN Question: Can’t figure out how to make the gym.Env put out two separate arrays. It just seems to combine them into 1 array containing 2 arrays. But fitting to DQN NN expects two arrays. I’m hoping to put the two arrays …

Total answers: 1

Whenever I try to use env.render() for OpenAIgym I get "AssertionError"?

Whenever I try to use env.render() for OpenAIgym I get "AssertionError"? Question: I am trying to learn Reinforcement learning. I wanted to build a Reinforcement Learning model for autonomous driving. However, whenever I use env.render() while training the Reinforcement learning model. It gives me an assertion error. The code is as below for my model: …

Total answers: 1

Python error, no results on the internet openai-gym

Python error, no results on the internet openai-gym Question: import gym env = gym.make("FrozenLake-v1") env.reset() env.render() env.step(1) env.render() Something went wrong with pygame. This should never happen. File "C:UsersardgnOneDriveBelgelerGitHubKutuphaneler-cheatsheetsGYMLibraryOPENAI", line 7, in <module> env.render() This is the error I get when I use the above code Asked By: ardgndg || Source Answers: Code works for …

Total answers: 1

OpenAI GYM's env.step(): what are the values?

OpenAI GYM's env.step(): what are the values? Question: I am getting to know OpenAI’s GYM (0.25.1) using Python3.10 with gym’s environment set to ‘FrozenLake-v1 (code below). According to the documentation, calling env.step() should return a tuple containing 4 values (observation, reward, done, info). However, when running my code accordingly, I get a ValueError: Problematic code: …

Total answers: 2

how can i install gym[box2d] despite errors below?

how can i install gym[box2d] despite errors below? Question: when i try to install gym[box2d] i get following error: i tried: pip install gym[box2d]. on anaconda prompt i installed swig and gym[box2d] but i code in python3.9 env and it still not working.(my text editor is pycharm) gym is already installed.and ERROR: Command errored out …

Total answers: 4