openai-gym

python binning data openAI gym

南楼画角 提交于 2019-12-08 10:04:16
问题 I am attempting to create a custom environment for reinforcement learning with openAI gym. I need to represent all possible values that the environment will see in a variable called observation_space . There are 3 possible actions for the agent to use called action_space To be more specific the observation_space is a temperature sensor which will see possible ranges from 50 to 150 degrees and I think I can represent all of this by: EDIT, I had the action_space numpy array wrong import numpy

How to use Box 2 D on google colab

纵然是瞬间 提交于 2019-12-08 05:40:12
问题 I am currently trying to optimize OpenAIGym's BipedalWalker with neat. In order to use Bipedalwalker, it is necessary to install Box 2 D, but a problem arises. In order to install Box 2 d on colab, we did the following first. !apt-get install python-box2d > /dev/null !pip install gym[Box_2D] import gym env = gym.make("BipedalWalker-v2") However, this caused the following error /usr/local/lib/python3.6/dist-packages/gym/envs/box2d/lunar_lander.py in <module>() 2 import numpy as np 3 ----> 4

Install pybox2d for python 3.6 with conda 4.3.21

久未见 提交于 2019-12-07 06:47:31
问题 i want to play with the lunar lander env from OpenAI gym. In order to run this code I need to install Box2d, this is where my problems arise. I am using ubuntu 16.04 with conda 4.3.21 and python 3.6. When I tried to run the environment I received the error: ModuleNotFoundError: No module named '_Box2D' So I tried the direct install of pybox2d: https://github.com/pybox2d/pybox2d/blob/master/INSTALL.md which yielded the same error message. Then I tried to install from GitHub following the way

Error following env.render() for OpenAI

我的梦境 提交于 2019-12-07 00:18:20
问题 I am trying to get the code below to work. import gym env = gym.make("CartPole-v0") env.reset() env.render() I have no problems running the first 3 lines but when I run the 4th I get the error: Traceback (most recent call last): File "<ipython-input-3-a692a1a1ffe7>", line 1, in <module> env.render() File "/home/mikedoho/gym/gym/core.py", line 150, in render return self._render(mode=mode, close=close) File "/home/mikedoho/gym/gym/core.py", line 286, in _render return self.env.render(mode,

openAI Gym NameError in Google Colaboratory

别说谁变了你拦得住时间么 提交于 2019-12-05 05:45:35
I've just installed openAI gym on Google Colab, but when I try to run 'CartPole-v0' environment as explained here . Code: import gym env = gym.make('CartPole-v0') for i_episode in range(20): observation = env.reset() for t in range(100): env.render() print(observation) action = env.action_space.sample() observation, reward, done, info = env.step(action) if done: print("Episode finished after {} timesteps".format(t+1)) break I get this: WARN: gym.spaces.Box autodetected dtype as <class 'numpy.float32'>. Please provide explicit dtype. -------------------------------------------------------------

Error following env.render() for OpenAI

我只是一个虾纸丫 提交于 2019-12-05 03:40:13
I am trying to get the code below to work. import gym env = gym.make("CartPole-v0") env.reset() env.render() I have no problems running the first 3 lines but when I run the 4th I get the error: Traceback (most recent call last): File "<ipython-input-3-a692a1a1ffe7>", line 1, in <module> env.render() File "/home/mikedoho/gym/gym/core.py", line 150, in render return self._render(mode=mode, close=close) File "/home/mikedoho/gym/gym/core.py", line 286, in _render return self.env.render(mode, close) File "/home/mikedoho/gym/gym/core.py", line 150, in render return self._render(mode=mode, close

How to run OpenAI Gym .render() over a server

空扰寡人 提交于 2019-12-03 00:12:42
问题 I am running a python 2.7 script on a p2.xlarge AWS server through Jupyter (Ubuntu 14.04). I would like to be able to render my simulations. Minimal working example import gym env = gym.make('CartPole-v0') env.reset() env.render() env.render() makes (among other things) the following errors: ... HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'. If you're running on a server, you may need a virtual frame buffer; something like this should work:

How to run OpenAI Gym .render() over a server

妖精的绣舞 提交于 2019-12-02 13:56:48
I am running a python 2.7 script on a p2.xlarge AWS server through Jupyter (Ubuntu 14.04). I would like to be able to render my simulations. Minimal working example import gym env = gym.make('CartPole-v0') env.reset() env.render() env.render() makes (among other things) the following errors: ... HINT: make sure you have OpenGL install. On Ubuntu, you can run 'apt-get install python-opengl'. If you're running on a server, you may need a virtual frame buffer; something like this should work: 'xvfb-run -s \"-screen 0 1400x900x24\" python <your_script.py>'") ... NoSuchDisplayException: Cannot

How can I register a custom environment in OpenAI's gym?

烈酒焚心 提交于 2019-11-30 23:12:30
I have created a custom environment, as per the OpenAI Gym framework; containing step , reset , action , and reward functions. I aim to run OpenAI baselines on this custom environment. But prior to this, the environment has to be registered on OpenAI gym. I would like to know how the custom environment could be registered on OpenAI gym? Also, Should I be modifying the OpenAI baseline codes to incorporate this? You do not need to modify baselines repo. Here is a minimal example. Say you have myenv.py , with all the needed functions ( step , reset , ...). The name of the class environment is

Open AI enviroment with changing action-space after each step

╄→尐↘猪︶ㄣ 提交于 2019-11-30 20:08:19
问题 Is there a way for me to implement openai environment, where the action space changes at each step? 回答1: Yes (though some of the premade agents may not work in this case). @property def action_space(self): # Do some code here to calculate the available actions return Something The @property decorator is so that you can fit the standard format for a gym environment, where the action_space is a property env.action_space rather than a method env.action_space() . 回答2: You could implement your own