Ml-agents: UnityEnvironmentException: The Unity environment took too long to respond

Created on 27 Sep 2017  路  3Comments  路  Source: Unity-Technologies/ml-agents

Hi,

I am trying to run the ML Agent 3D Ball example project but I am receiving an error in Jupyter during the "Load the Environment" cell. The Unity application opens up and the balls falls down on the plates and rolls down. The application runs for e.g. 30 seconds or so until it closes, and the following error can be seen in in Jupyter:

"UnityEnvironmentException: The Unity environment took too long to respond. Make sure environment does not need user interaction to launch and that the Academy and the external Brain(s) are attached to objects in the Scene."

The setup I am using is:

  • Unity 2017.1.1f1
  • Mac OSX Sierra 10.12.6
  • Tensorflow 1.3
  • Anaconda 4.3.27
  • Python 3.6

The following trace was printed:

`---------------------------------------------------------------------------
timeout Traceback (most recent call last)
~/Unity Projects/ml-agents/python/unityagents/environment.py in __init__(self, file_name, worker_id, base_port)
84 self._socket.listen(1)
---> 85 self._conn, _ = self._socket.accept()
86 self._conn.setblocking(1)

~/anaconda3/lib/python3.6/socket.py in accept(self)
204 """
--> 205 fd, addr = self._accept()
206 # If our type has the SOCK_NONBLOCK flag, we shouldn't pass it onto the

timeout: timed out

During handling of the above exception, another exception occurred:

UnityEnvironmentException Traceback (most recent call last)
in ()
----> 1 env = UnityEnvironment(file_name=env_name)
2 print(str(env))
3 brain_name = env.brain_names[0]

~/Unity Projects/ml-agents/python/unityagents/environment.py in __init__(self, file_name, worker_id, base_port)
91 "The Unity environment took too long to respond. Make sure {} does not need user interaction to launch "
92 "and that the Academy and the external Brain(s) are attached to objects in the Scene.".format(
---> 93 str(file_name)))
94 except UnityEnvironmentException:
95 proc1.kill()

UnityEnvironmentException: The Unity environment took too long to respond. Make sure environment does not need user interaction to launch and that the Academy and the external Brain(s) are attached to objects in the Scene.`

Most helpful comment

you prob forgot to do this step. I got same errors when i didn't do it.

"Expand the Ball3DAcademy GameObject and locate its child object Ball3DBrain within the Scene hierarchy in the editor. Ensure Type of Brain for this object is set to External."

All 3 comments

you prob forgot to do this step. I got same errors when i didn't do it.

"Expand the Ball3DAcademy GameObject and locate its child object Ball3DBrain within the Scene hierarchy in the editor. Ensure Type of Brain for this object is set to External."

Thank you @liuyihunter, that did the trick for me!

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GuntherFox picture GuntherFox  路  3Comments

RavenLeeANU picture RavenLeeANU  路  4Comments

Procuste34 picture Procuste34  路  3Comments

dlindmark picture dlindmark  路  3Comments

MarkTension picture MarkTension  路  3Comments