openai / gym

A toolkit for developing and comparing reinforcement learning algorithms.
https://www.gymlibrary.dev
Other
34.48k stars 8.59k forks source link

Cannot Run Any OpenAi Code Even The "Simplest" #1303

Closed iseegr8tfuldeadppl closed 5 years ago

iseegr8tfuldeadppl commented 5 years ago

so i was trying to run the following code copied from the repository and it errored me out with the huge text, i'm not sure what is wrong with docker anyone got a clue!

import gym
import universe  # register the universe environments

env = gym.make('flashgames.DuskDrive-v0')
env.configure(remotes=1)  # automatically creates a local docker container
observation_n = env.reset()

while True:
  action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]  # your agent here
  observation_n, reward_n, done_n, info = env.step(action_n)
  env.render()

`

kream@KRIMSON:~/openai$ python openai_test.py [2019-01-31 00:28:49,830] Making new env: flashgames.DuskDrive-v0 /home/kream/.local/lib/python2.7/site-packages/gym/envs/registration.py:17: PkgResourcesDeprecationWarning: Parameters to load are deprecated. Call .resolve and .require separately. result = entry_point.load(False) [2019-01-31 00:28:49,834] Writing logs to file: /tmp/universe-15684.log [2019-01-31 00:28:49,836] Connection pool is full, discarding connection: localhost Traceback (most recent call last): File "openai_test.py", line 5, in <module> env.configure(remotes=1) # automatically creates a local docker container File "/home/kream/universe/universe/wrappers/timer.py", line 14, in configure self.env.configure(**kwargs) File "/home/kream/universe/universe/wrappers/render.py", line 21, in configure self.env.configure(**kwargs) File "/home/kream/universe/universe/wrappers/throttle.py", line 32, in configure self.env.configure(**kwargs) File "/home/kream/universe/universe/envs/vnc_env.py", line 199, in configure use_recorder_ports=record, File "/home/kream/universe/universe/remotes/build.py", line 19, in build n=n, File "/home/kream/universe/universe/remotes/docker_remote.py", line 44, in __init__ self._assigner = PortAssigner(reuse=reuse) File "/home/kream/universe/universe/remotes/docker_remote.py", line 163, in __init__ self.client, self.info = get_client() File "/home/kream/universe/universe/remotes/docker_remote.py", line 157, in get_client return docker.Client(base_url=host, version=client_api_version), info File "/home/kream/.local/lib/python2.7/site-packages/docker/client.py", line 99, in __init__ self._version = self._retrieve_server_version() File "/home/kream/.local/lib/python2.7/site-packages/docker/client.py", line 124, in _retrieve_server_version 'Error while fetching server API version: {0}'.format(e) docker.errors.DockerException: Error while fetching server API version: Timeout value connect was Timeout(connect=60, read=60, total=None), but it must be an int or float. kream@KRIMSON:~/openai$

shuruiz commented 5 years ago

It's too vague. Can you comment the env.render() line and post the running result again?

christopherhesse commented 5 years ago

I'm afraid this is an issue with universe, which is not currently supported. Sorry about that!