Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnityEnvironmentException: The Unity environment took too long to respond #47

Closed
MarcPilgaard opened this issue Sep 27, 2017 · 3 comments

Comments

@MarcPilgaard
Copy link

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.`

@liuyihunter
Copy link

liuyihunter commented Sep 27, 2017

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."

@MarcPilgaard
Copy link
Author

MarcPilgaard commented Sep 27, 2017

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

@lock
Copy link

lock bot commented Jan 4, 2020

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.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants