openai / universe

Universe: a software platform for measuring and training an AI's general intelligence across the world's supply of games, websites and other applications.
https://universe.openai.com
MIT License
7.47k stars 961 forks source link

VNC Error: ValueError: invalid literal for int() with base 10: '$port' #114

Closed ProgramItUp closed 7 years ago

ProgramItUp commented 7 years ago

I'm trying to executing the sample code on https://openai.com/blog/GTA-V-plus-Universe/

When I get to env.configure(remotes='vnc://$host:$port') # point to the GTA V Universe server the following error is thrown:

hardcoded_addresses.py", line 122, in parse_remotes
    vnc_port = int(vnc_port)
ValueError: invalid literal for int() with base 10: '$port'

The error message is not giving me a lot to go on to debug. What am I missing? Full script and error attached at the bottom of the issue submission.

Expected behavior

No error

Actual behavior

File "/home/me/dgx/universe/universe/remotes/hardcoded_addresses.py", line 122, in parse_remotes vnc_port = int(vnc_port) ValueError: invalid literal for int() with base 10: '$port'

Versions

Please include the result of running

$ uname -a ; python --version; pip show universe gym tensorflow numpy go-vncdriver Pillow
$  uname -a ; python --version; pip show universe gym tensorflow numpy go-vncdriver Pillow
Linux nsk1vidia02.crd.ge.com 4.4.0-45-generic #66~14.04.1-Ubuntu SMP Wed Oct 19 15:05:38 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Python 2.7.6
---
Name: universe
Version: 0.21.2
Location: /home/me/dgx/universe
Requires: autobahn, docker-py, docker-pycreds, fastzbarlight, go-vncdriver, gym, Pillow, PyYAML, six, twisted, ujson
---
Name: gym
Version: 0.7.2
Location: /usr/local/lib/python2.7/dist-packages
Requires: numpy, requests, six, pyglet
---
Name: numpy
Version: 1.11.3
Location: /usr/local/lib/python2.7/dist-packages
Requires:
---
Name: go-vncdriver
Version: 0.4.19
Location: /usr/local/lib/python2.7/dist-packages
Requires: numpy
---
Name: Pillow
Version: 4.0.0
Location: /usr/local/lib/python2.7/dist-packages
Requires: olefile

Full execution trace:

$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19)
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gym
>>> import gym
>>> import universe # register Universe environments into Gym
>>> from universe.spaces import joystick_event
>>>
>>> env = gym.make('gtav.SaneDriving-v0')
[2017-01-16 00:34:03,633] Making new env: gtav.SaneDriving-v0
>>> env.configure(remotes='vnc://$host:$port') # point to the GTA V Universe server
[2017-01-16 00:34:15,554] Writing logs to file: /tmp/universe-20288.log
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/me/dgx/universe/universe/vectorized/core.py", line 39, in _configure
    super(Wrapper, self)._configure(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 349, in _configure
    return self.env.configure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/me/dgx/universe/universe/wrappers/render.py", line 18, in _configure
    super(Render, self)._configure(**kwargs)
  File "/home/me/dgx/universe/universe/vectorized/core.py", line 39, in _configure
    super(Wrapper, self)._configure(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 349, in _configure
    return self.env.configure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/me/dgx/universe/universe/wrappers/throttle.py", line 27, in _configure
    super(Throttle, self)._configure(**kwargs)
  File "/home/me/dgx/universe/universe/vectorized/core.py", line 39, in _configure
    super(Wrapper, self)._configure(**kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 349, in _configure
    return self.env.configure(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/gym/core.py", line 224, in configure
    self._configure(*args, **kwargs)
  File "/home/me/dgx/universe/universe/envs/vnc_env.py", line 196, in _configure
    use_recorder_ports=record,
  File "/home/me/dgx/universe/universe/remotes/build.py", line 24, in build
    start_timeout=start_timeout)
  File "/home/me/dgx/universe/universe/remotes/hardcoded_addresses.py", line 23, in build
    vnc_addresses, rewarder_addresses = parse_remotes(addresses)
  File "/home/me/dgx/universe/universe/remotes/hardcoded_addresses.py", line 122, in parse_remotes
    vnc_port = int(vnc_port)
ValueError: invalid literal for int() with base 10: '$port'
tlbtlbtlb commented 7 years ago

You have to replace $host and $port with the actual IP address and port numbers of the GTAV remote. It might look like vnc://10.11.12.13:5900+15900. The instructions for setting up a server are here: https://github.com/openai/universe-windows-envs/blob/master/vnc-gtav/README.md#using-the-prebuilt-ami

ProgramItUp commented 7 years ago

@tlbtlbtlb Thanks. Your prompt replies are always appreciated.

I missed the statement a few lines above the code "You can attach an agent by running the following code."

Feature request: Check that $host and $port are not null and if they are remind the user "A hostname and port must both be supplied, use the values for VNC server running your AI agent. If the agent is not yet running, start it now."

Musing: Seems like GTA agent would be a good candidate for an example in https://github.com/openai/universe/tree/master/example. It has more depth and complexity than most of the agents.

tlbtlbtlb commented 7 years ago

We're working on GTAV agents, but an agent that performs well on it is still a open research project.