Questions tagged [openai-gym]
OpenAI Gym is a platform for reinforcement learning research that aims to provide a general-intelligence benchmark with a wide variety of environments.
783
questions
-2
votes
0
answers
30
views
why there is a DeprecationWarning error when I run openai app?
I already did pip install gym and it said gym installed successfully
but I don't know why it gives me this error
C:\Users\azizm\AppData\Local\Programs\Python\Python310\lib\site-packages\gym\wrappers\...
0
votes
0
answers
9
views
Can't find different version of ma_gym
I found the environments of ma_gym:
https://github.com/koulanurag/ma-gym
Although in the wiki they talk about several environments, we can only find one of each environment in the folders. Does anyone ...
0
votes
0
answers
9
views
Difference between 'right', 'rightfire', 'left', and 'leftfire' in gym action space
I am wondering what the actual difference between is 'right', 'rightfire', 'left', and 'leftfire' in action space, especially for the Pong game.
Most people say right and rightfire are the same and ...
0
votes
0
answers
14
views
How to train two half cheetha opengym environments using same DDPG ( neural networks) simultaneously in reinforcement learning?
How to train two half cheetha opengym environments with single neural network of DDPG in reinforcement learning? Objective is to implement single DDPG (one main actor, one main critic, one target ...
0
votes
1
answer
23
views
"display Surface quit" error when using OpenAI Gym in Jupyter Notebook
I am trying to follow the tutorial here: https://github.com/microsoft/ML-For-Beginners/blob/main/8-Reinforcement/2-Gym/README.md
I can run the block of code 1 shown below once, but when I run this ...
0
votes
0
answers
24
views
pip install gym package but import error given
I created my tensorflow env using conda (MacBook Pro), and installed manually all the tensorflow required packages following the apple developer website:
https://developer.apple.com/metal/tensorflow-...
0
votes
0
answers
20
views
Reinforcement Learning of Kniffel/Yahtzee
I set myself the challenge to develop a deep reinforcement learning algorithm to solve the game Kniffel/Yahtzee. I coded the game with Python and inserted it into a custom open ai gym environment.
...
0
votes
0
answers
23
views
How do I train a model for an environment with variable features using openai gym?
I have a grid network (like a maze) and I want to find the shortest route from the source node to the destination node.
I've coded that and it works well. It finds the shortest route for a network of ...
-1
votes
0
answers
15
views
How is profit calculated in gym environment?
So I'm using the gym stocks environment to train a model using A2C policy but I want to understand how the profit is calculated by the model, in the documentation that I read it said that the profit ...
0
votes
0
answers
38
views
OpenAI Gym - Env.Render() function returning "Display surface quit"
A screenshot of my code with error
I am following the tutorial seen at https://www.youtube.com/watch?v=7SVv07QXO5M&ab_channel=HackersRealm
The exact code I am following is here: https://github.com/...
1
vote
1
answer
27
views
Why I can't I set an attribute on an OpenAI Gym environment directly
So I am running into an interesting bug when writing a custom OpenAI gym environment. The code below is the minimal environment I can write that reproduces the bug:
import gym
class TestEnv(gym.Env):
...
0
votes
0
answers
18
views
Unable to find KeyError cause when calling TRPO agent.learn() in OpenAI Gym
I get a keyerror upon calling the TRPO agent.learn() even though the key is defined in the observation below. Can anyone point out what might the reason for this?
self.observation_space = gym.spaces....
0
votes
0
answers
41
views
How to solve OpenAI gym's 'Module has no attribute error'
I follow the exact same folder structure for OpenAI Gym but still get attribute not found error upon using gym.make(). My folder structure is as below.
my_gym
-->examples
---MAIN_ENV
--&...
0
votes
0
answers
12
views
Getting Type error with setup file in OpenAI gym
I am working with OpenAI Gym & trying to re-implement an existing code for learning purposes. But I get some type error with the setup file. I cannot even comprehend it and so, pasting the ...
0
votes
0
answers
70
views
Why multiprocessing in Stable Baselines 3 is slower?
I took multiprocessing example for Stable Baselines 3 and everything was fine.
https://colab.research.google.com/github/Stable-Baselines-Team/rl-colab-notebooks/blob/sb3/multiprocessing_rl.ipynb#...
0
votes
0
answers
24
views
Why does my Atari Gym observation take so long to load into CUDA and run on my GPU?
I'm wondering why every new observation of my Pong gym environment takes so long to load onto my GPU.
I am attempting to train a Policy Gradient model to play Pong. I have included my entire code ...
0
votes
0
answers
43
views
Trying use openAI gym, getting a pyglet/openGL error on running
I am trying the following code:
import gym
env = gym.make('ma_gym:Switch2-v0')
done_n = [False for _ in range(env.n_agents)]
ep_reward = 0
obs_n = env.reset()
while not all(done_n):
env.render()
...
0
votes
0
answers
10
views
OpenAI Gym with Neat experiment not working in Jupyter
import os
import gym
import neat
import neat.config
import configparser
import multiprocessing
import graphviz
import numpy as np
def eval_genome(genome, config):
# Creates 'FeedForward' Network ...
1
vote
1
answer
945
views
I'm getting an error with env rendering - env.render()
I was trying to implement Atari Games while rendering I get an error as given below:
line 283, in render
raise error.Error(
gym.error.Error: render(mode='human') is deprecated. Please supply `...
1
vote
2
answers
402
views
ImportError: cannot import 'rendering' from 'gym.envs.classic_control'
I'm working with RL agents, and was trying to replicate the finding of the this paper, wherein they make a custom parkour environment based on Gym open AI, however when trying to render this ...
0
votes
1
answer
54
views
Getting xvfb to work in jupyter notebook on M1 Mac
I am working with OpenAI gym on colab and using the following code to render the videos within Jupyter notebook based on this tutorial: https://colab.research.google.com/drive/...
0
votes
0
answers
20
views
Standard Error from Hessian Matrix for custom Error function
I was trying to compute the standard error from hessian matrix for a custom error function for Keras. I am working with the Gym Open AI environment, right now specifically on the CartPole-v0 where the ...
0
votes
1
answer
33
views
The DQN model cannot correctly come out the expected scores
I am working on a DQN training model of the game "CartPole-v1". In this model, the system did not remind any error information in the terminal. However, The result evaluation got worse.This ...
0
votes
0
answers
43
views
Gym reports error when I import "MsPacman-v4" game (about ROMs?)
I tried to use "MsPacman-v4" as my environment of agent, but my python reported me the following message.
gym.error.Error: We're Unable to find the game "MsPacman". Note: Gym ...
0
votes
0
answers
19
views
OpenAI - Change render screen size
import gym
env = gym.make('Ant-v3')
action_space = env.action_space
obs = env.reset()
screen = env.render(mode='rgb_array')
print(screen.shape)
So I have this code above that gets an image from the ...
0
votes
0
answers
25
views
OpenAI - CarRacing-v1 observations are just numpy arrays of 0s
import gym
from gym.spaces import Box
import numpy as np
from PIL import Image as im
env = gym.make('CarRacing-v1')
action_space = env.action_space
env.observation_space = Box(low=0, high=255, shape=(...
1
vote
0
answers
148
views
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 ...
0
votes
0
answers
40
views
RuntimeError: The size of tensor a (4) must match the size of tensor b (2) at non-singleton dimension 0
I'm attempting to convert my code from the Cartpole environment to other classic environments in Open AI Gym, such as MountainCar. However, I keep getting this runtime error. Could someone please ...
0
votes
0
answers
16
views
How does the is_slippery parameter affect the reward in Frozenlake Environment?
How does the is_slippery parameter affect the reward in Frozenlake Environment?
Frozenlake environment has a parameter named is_slippery, which if set to True will move in intended direction with ...
0
votes
1
answer
32
views
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 ...
1
vote
0
answers
86
views
Why is the Stable-Baselines3 evaluate_policy() function never finishing/completing?
I have created my own custom environment using OpenAI Gym and Stable-Baselines3. Once I've trained the agent, I try to evaluate the policy using the evaluate_policy() function from stable_baselines3....
1
vote
0
answers
42
views
How do I discretise a continuous observation and action space in Python?
My professor has asked me to apply a Policy Iteration method on the Pendulum-V1 gym environment in OpenAI.
Pendulum-V1 has the following Environment:
Observation
Type: Box(3)
Num
Observation
Min
Max
...
0
votes
1
answer
79
views
MuJoCo via mujoco-py interface FetchReach-v1 scenario robotic action delay
Dear MuJoCo community,
in last few days I was working with a simple FetchReach-v1 scenario in open-ai gym MuJoCo environment. I was trying to apply the MPC (Model Predictive Control) to this scenario ...
0
votes
0
answers
28
views
Is there a OpenAI Gym action space that can store specified discrete numbers
I am trying to create a custom gym environment for a Connect Four game. My plan with this environment is to train a Connect Four AI with DQN using stable-baselines3.
When creating this environment, I ...
0
votes
0
answers
28
views
Typerror with int() argument while training RL agent using OpenAI gym
I am trying to train an RL agent with my custom environment using TensorFlow and Open AI gym. I use PPO agent. The command I use is
ag = myagent.learn(total_timesteps=1000, callback=callback)
#...
0
votes
0
answers
60
views
Converting gym.box into gym.discrete in openAI gym
I'm trying to implement Q Learning algorithm over some of the test beds in gym OpenAI and was trying to convert some of the space since different environment have different action and observation ...
1
vote
1
answer
81
views
Error while defining observation space in gym custom environment
I am working on a reinforcement algorithm, I am very new to this and trying to get a hold of things.
Player1Env looks upon a 7x6 Connect4 playing grid. I am initializing the class as follows:
def ...
0
votes
0
answers
159
views
Environment Does Not Exist When Registering OpenAI Gym Environment
I am trying to register a custom gym environment on a remote server, but it is not working. I have been able to successfully register this environment on my personal computer using the Anaconda ...
0
votes
1
answer
43
views
Parallel environments in Pong keep ending up in the same state despite random actions being taken
Hi I am trying to use the SubprocVecEnv to run 8 parallel Pong environment instances. I tried testing the state transitions using random actions but after 15 steps (with random left or right actions), ...
0
votes
1
answer
95
views
AI Gym environment: no module found error despite all steps correct
I am very sure that I followed the correct steps to register my custom environment in the AI Gym. But I face a problem when one __ init__.py file is not recognizing a folder and gives no module found ...
0
votes
0
answers
81
views
AttributeError: 'CarRacing' object has no attribute 'viewer'
Hello i make gym enviroment CarRacing. This is my code.
def key_press(k, mod):
if k == key.LEFT: a[0] = -1.0
if k == key.RIGHT: a[0] = +1.0
if k == key.UP: a[1] = +1.0
if k == key.DOWN: a[...
0
votes
1
answer
34
views
Error running model trained on cloud on local machine
I trained a reinforcement learning model using a GPU instance from Lambda Labs cloud service. The library I used for training is stable_baselines3.
When I try to run the model on my local machine I ...
1
vote
1
answer
166
views
gym car racing v0 using DQN
I am currently learning reinforcement learning and wanted to use it on the car racing-v0 environment. I have successfully made it using PPO algorithm and now I want to use a DQN algorithm but when I ...
0
votes
0
answers
33
views
CarRacing-v0 in Gym: The screen is totally black when I run the environment
I'm trying to run one of the gym environments, CarRacing, with the code from (https://gist.github.com/lmclupr/b35c89b2f8f81b443166e88b787b03ab) modified to work with the current versions of Keras etc.
...
0
votes
0
answers
35
views
Stable Baselines 3 DDPG and TD3 Agents both stop at a specific step and compute forever
I'm testing different DRL Agents on a Custom Environment using Stable Baselines 3 and Gym. I tested A2C and PPO Agents on the environment and everything works fine but when I test an Agent with DDPG ...
0
votes
0
answers
44
views
how to set a trigger for when to record video open ai gym
I run multiple episodes, but only want to record for specific ones. More specifically, I'd like to have an input acting as trigger. Currently, my code is this:
env = gym.make("HalfCheetah-v3"...
0
votes
0
answers
16
views
Cannot import gym_wrapper for ACME, any solution?
Import of acme is successfull, but not able to find gym wrapper class
import acme
from acme.wrappers import gym_wrapper
Error Message while running
ModuleNotFoundError Traceback ...
0
votes
0
answers
90
views
how to avoid this error (Error : display Surface quit ) when rendering open-AIgym?
I am trying to solve the mountain car problem in AI gym, but when I use env. render()it works the first time, but when I try to render the simulation again after 2000 runs it gives the below error ( ...
2
votes
2
answers
117
views
Which OpenAI gym environment should be used for solve the shortest route problem?
I am trying to fine the shortest route between two nodes using reinforcement learning. I am not sure what environment to use. I have found this particular environment and am not sure if I am going in ...
0
votes
1
answer
747
views
AttributeError: 'TaxiEnv' object has no attribute 's'
I am trying to use TaxiEnvironment of OpenAI Gym. I have written the following lines of code and I am getting the following error.
import numpy as np
import gym
import random
env = gym.make("Taxi-...