Unity-Technologies / obstacle-tower-challenge

Starter Kit for the Unity Obstacle Tower challenge
Apache License 2.0
119 stars 38 forks source link

The Unity environment took too long to respond (Ubuntu 18.04) #16

Open theophilegervet opened 5 years ago

theophilegervet commented 5 years ago

Hi,

I have followed the instructions at https://github.com/Unity-Technologies/obstacle-tower-challenge. The output of "python run.py" is the following:

Found path: /home/theophile/Software/github/obstacle-tower-challenge/./ObstacleTower/obstacletower.x86_64 Mono path[0] = '/home/theophile/Software/github/obstacle-tower-challenge/./ObstacleTower/obstacletower_Data/Managed' Mono config path = '/home/theophile/Software/github/obstacle-tower-challenge/./ObstacleTower/obstacletower_Data/MonoBleedingEdge/etc' Preloaded 'ScreenSelector.so' Preloaded 'libgrpc_csharp_ext.x64.so' Logging to /home/theophile/.config/unity3d/Unity Technologies/ObstacleTower/Player.log Traceback (most recent call last): File "run.py", line 26, in env = ObstacleTowerEnv(args.environment_filename, docker_training=args.docker_training) File "/home/theophile/anaconda3/envs/obstacle-tower-challenge/lib/python3.6/site-packages/obstacle_tower_env.py", line 39, in init self._env = UnityEnvironment(environment_filename, worker_id, docker_training=docker_training) File "/home/theophile/anaconda3/envs/obstacle-tower-challenge/lib/python3.6/site-packages/mlagents_envs/environment.py", line 69, in init aca_params = self.send_academy_parameters(rl_init_parameters_in) File "/home/theophile/anaconda3/envs/obstacle-tower-challenge/lib/python3.6/site-packages/mlagents_envs/environment.py", line 491, in send_academy_parameters return self.communicator.initialize(inputs).rl_initialization_output File "/home/theophile/anaconda3/envs/obstacle-tower-challenge/lib/python3.6/site-packages/mlagents_envs/rpc_communicator.py", line 80, in initialize "The Unity environment took too long to respond. Make sure that :\n" mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that : The environment does not need user interaction to launch The Academy and the External Brain(s) are attached to objects in the Scene

I'm running the code in a condo environment with the following packages:

Name Version Build Channel absl-py 0.7.0 pypi_0 pypi aicrowd-repo2docker 0.7.0 pypi_0 pypi astor 0.7.1 pypi_0 pypi atomicwrites 1.3.0 pypi_0 pypi attrs 18.2.0 pypi_0 pypi backcall 0.1.0 pypi_0 pypi bleach 1.5.0 pypi_0 pypi ca-certificates 2019.1.23 0
certifi 2018.11.29 py36_0
chardet 3.0.4 pypi_0 pypi cycler 0.10.0 pypi_0 pypi dbus 1.13.6 h746ee38_0
decorator 4.3.2 py36_0
defusedxml 0.5.0 pypi_0 pypi docker 3.7.0 pypi_0 pypi docker-pycreds 0.4.0 pypi_0 pypi docopt 0.6.2 pypi_0 pypi entrypoints 0.3 pypi_0 pypi escapism 1.0.0 pypi_0 pypi expat 2.2.6 he6710b0_0
fontconfig 2.13.0 h9420a91_0
freetype 2.9.1 h8a8886c_1
future 0.17.1 pypi_0 pypi gast 0.2.2 pypi_0 pypi glib 2.56.2 hd408876_0
gmp 6.1.2 h6c8ec71_1
grpcio 1.11.1 pypi_0 pypi gst-plugins-base 1.14.0 hbbd80ab_1
gstreamer 1.14.0 hb453b48_1
gym 0.11.0 pypi_0 pypi html5lib 0.9999999 pypi_0 pypi icu 58.2 h9c2bf20_1
idna 2.8 pypi_0 pypi ipykernel 5.1.0 py36h39e3cac_0
ipython 7.2.0 py36h39e3cac_0
ipython-genutils 0.2.0 pypi_0 pypi ipython_genutils 0.2.0 py36_0
ipywidgets 7.4.2 py36_0
jedi 0.13.2 pypi_0 pypi jinja2 2.10 pypi_0 pypi jpeg 9b h024ee3a_2
jsonschema 2.6.0 pypi_0 pypi jupyter 1.0.0 py36_7
jupyter-console 6.0.0 pypi_0 pypi jupyter_client 5.2.4 py36_0
jupyter_console 6.0.0 py36_0
jupyter_core 4.4.0 py36_0
kiwisolver 1.0.1 pypi_0 pypi libedit 3.1.20181209 hc058e9b_0
libffi 3.2.1 hd88cf55_4
libgcc-ng 8.2.0 hdf63c60_1
libpng 1.6.36 hbc83047_0
libsodium 1.0.16 h1bed415_0
libstdcxx-ng 8.2.0 hdf63c60_1
libuuid 1.0.3 h1bed415_2
libxcb 1.13 h1bed415_1
libxml2 2.9.9 he19cac6_0
markdown 3.0.1 pypi_0 pypi markupsafe 1.1.0 pypi_0 pypi matplotlib 3.0.2 pypi_0 pypi mistune 0.8.4 py36h7b6447c_0
mlagents-envs 0.6.2 pypi_0 pypi more-itertools 6.0.0 pypi_0 pypi nb_conda 2.2.1 py36_0
nb_conda_kernels 2.2.0 py36_1
nbconvert 5.4.1 pypi_0 pypi nbformat 4.4.0 py36_0
ncurses 6.1 he6710b0_1
notebook 5.7.4 py36_0
numpy 1.14.5 pypi_0 pypi obstacle-tower-env 1.1 pypi_0 pypi openssl 1.1.1a h7b6447c_0
pandoc 2.2.3.2 0
pandocfilters 1.4.2 py36_1
parso 0.3.4 pypi_0 pypi pcre 8.42 h439df22_0
pexpect 4.6.0 py36_0
pickleshare 0.7.5 pypi_0 pypi pillow 5.4.1 pypi_0 pypi pip 19.0.1 py36_0
pluggy 0.8.1 pypi_0 pypi prometheus-client 0.5.0 pypi_0 pypi prometheus_client 0.5.0 py36_0
prompt_toolkit 2.0.8 py_0
protobuf 3.6.1 pypi_0 pypi ptyprocess 0.6.0 pypi_0 pypi py 1.7.0 pypi_0 pypi pyglet 1.3.2 pypi_0 pypi pygments 2.3.1 pypi_0 pypi pyparsing 2.3.1 pypi_0 pypi pyqt 5.9.2 py36h05f1152_2
pytest 3.10.1 pypi_0 pypi python 3.6.8 h0371630_0
python-dateutil 2.8.0 pypi_0 pypi python-json-logger 0.1.10 pypi_0 pypi pyyaml 3.13 pypi_0 pypi pyzmq 17.1.2 pypi_0 pypi qt 5.9.7 h5867ecd_1
qtconsole 4.4.3 pypi_0 pypi readline 7.0 h7b6447c_5
requests 2.21.0 pypi_0 pypi ruamel-yaml 0.15.88 pypi_0 pypi scipy 1.2.1 pypi_0 pypi send2trash 1.5.0 pypi_0 pypi setuptools 40.7.3 py36_0
sip 4.19.8 py36hf484d3e_0
six 1.12.0 pypi_0 pypi sqlite 3.26.0 h7b6447c_0
tensorboard 1.7.0 pypi_0 pypi tensorflow 1.7.1 pypi_0 pypi termcolor 1.1.0 pypi_0 pypi terminado 0.8.1 pypi_0 pypi testpath 0.4.2 py36_0
tk 8.6.8 hbc83047_0
tornado 5.1.1 pypi_0 pypi traitlets 4.3.2 py36_0
urllib3 1.24.1 pypi_0 pypi wcwidth 0.1.7 pypi_0 pypi webencodings 0.5.1 py36_1
websocket-client 0.54.0 pypi_0 pypi werkzeug 0.14.1 pypi_0 pypi wheel 0.32.3 py36_0
widgetsnbextension 3.4.2 pypi_0 pypi xz 5.2.4 h14c3975_4
zeromq 4.3.1 he6710b0_3
zlib 1.2.11 h7b6447c_3

I don't know how to proceed from the error message, could you help me? Thank you very much, very excited about this challenge!

awjuliani commented 5 years ago

Hi @theophilee

Are you running this on a machine with a display, or on the cloud? If you have a display, do you see a window being launched when the script runs?

miha-skalic commented 5 years ago

hijacking the issue.

@theophilee I have similar issue here.

Locally env = ObstacleTowerEnv(env_exc, docker_training=False) works, but if I ssh into another machine it doesn't (if I do ssh -XY a window temporarily pops up, but still nothing happens).

Thanks for any potential help.

Edit for more information: it doesn't either if X Server is running or not.

theophilegervet commented 5 years ago

@awjuliani thanks for the quick reply! Actually I was running this through ssh, now that I'm running it without ssh everything works perfectly.

theophilegervet commented 5 years ago

I have two more related issues: 1) The window that pops up displays a black screen, is that normal? I still get the expected images when printing observations in the notebook. 2) How to run the environment without display so that it runs on a cluster and I don't get the above error?

awjuliani commented 5 years ago

Hi @theophilee

  1. This is normal. We disable rendering to the window by default to save on unnecessary computation.
  2. In order to run without a display, you either can use a virtual x-server, or xvfb. The docker image we provides comes w/ xvfb set up for this. See our GCP training guide for instructions on setting up a virtual x server: https://github.com/Unity-Technologies/obstacle-tower-env/blob/master/examples/gcp_training.md
zook111 commented 5 years ago

hijacking the issue x2

same issue,

 "The Unity environment took too long to respond. Make sure that :\n"
mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
     The environment does not need user interaction to launch
     The Academy and the External Brain(s) are attached to objects in the Scene
     The environment and the Python interface have compatible versions.

using osx with screen, no poup window seen. Thanks in advance

parilo commented 5 years ago

same for me

2019-03-06T21:26:23.403778832Z     "The Unity environment took too long to respond. Make sure that :\n"
2019-03-06T21:26:23.4037833Z mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
2019-03-06T21:26:23.403787914Z   The environment does not need user interaction to launch
2019-03-06T21:26:23.40380252Z    The Academy and the External Brain(s) are attached to objects in the Scene
2019-03-06T21:26:23.403807104Z   The environment and the Python interface have compatible versions.
panda-saroj commented 5 years ago

Same issue.

"The Unity environment took too long to respond. Make sure that :\n" mlagents_envs.exception.UnityTimeOutException: The Unity environment took too long to respond. Make sure t hat : The environment does not need user interaction to launch The Academy and the External Brain(s) are attached to objects in the Scene The environment and the Python interface have compatible versions. In call to configurable 'create_otc_environment' (<function create_otc_environment at 0x7f23eddff8c8>) In call to configurable 'Runner' (<function Runner.init at 0x7f23eddf7b70>) In call to configurable 'create_runner' (<function create_runner at 0x7f23eddf79d8>)

I am running it through ssh on a Linux server.

wzt1001 commented 4 years ago

I changed no_graphic to true when initiating the environment and everything works fine (even in ssh)

reubenwong97 commented 4 years ago

Hi! I am experiencing the same issue and am running on Ubuntu 16 without a display and through ssh, could you share how you set no_graphic to true?

awjuliani commented 4 years ago

@reubenwong97 Are you running a virtual x-server on the machine? https://github.com/Unity-Technologies/obstacle-tower-env/blob/master/examples/gcp_training.md#set-up-xserver

reubenwong97 commented 4 years ago

Hi @awjuliani , I have managed to provision another machine running Ubuntu 18.04 with a display. However, I get the same error and there is no pop-up screen indicating that the environment is running. It works when I exported it to Windows though. Any clue as to what is going on? Do I still need to set up x-server? Thank you!

awjuliani commented 4 years ago

Hi @reubenwong97

Are you using the latest binaries? They are available here: https://github.com/Unity-Technologies/obstacle-tower-env#download-the-environment. If so, can you launch the environment and interact without manually (not through python)?

Harsha-Musunuri commented 4 years ago

Experiencing same Timeout issue - works perfect with headless but my work needs visual observations. Pls help

MarcoMeter commented 4 years ago

@Harsha-Musunuri Which platform are you using? If you use a Linux based headless system, you'll need to have a running X service.

Harsha-Musunuri commented 4 years ago

@MarcoMeter My project requires visual observations - so I understood to do such training through SSH we X server or xvfb. Dont have admin privileges to install Xorg. I am actually, not sure, how to proceed from here.

Upon building the env as server build (headless) it works perfectly but the visual observations are greyed because it is headless.. Need the visual observations. I will be grateful for any possible solution..

Harsha-Musunuri commented 4 years ago

Is there something like a docker that i can activate and run the environment in it ?

Harsha-Musunuri commented 4 years ago

@Harsha-Musunuri Which platform are you using? If you use a Linux based headless system, you'll need to have a running X service. It's Linux server

MarcoMeter commented 4 years ago

For every Unity environment that cannot run headless (due to visual observations) needs a virtual display to be available in order to render the output of the environment.

As of now, the only solution is to host an X server like how it is described here: https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Training-on-Amazon-Web-Service.md

Ask the people with admin privileges to make X available. That's the only advice I can give.

Harsha-Musunuri commented 4 years ago

Hi @MarcoMeter Got it!!

xvfb is now installed on the server and I am able to run my env flawlessly.