Unity-Technologies / ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
https://unity.com/products/machine-learning-agents
Other
16.93k stars 4.14k forks source link

Is the provided Jupyter Notebook out of date? #3051

Closed DVonk closed 4 years ago

DVonk commented 4 years ago

I've re-installed ML-Agents and tried to connect to a build of the 3DBall environment with the provided Jupyter Notebook. This leads to the build launching, not responding, and this error in the notebook:

INFO:mlagents.envs: 'Ball3DAcademy' started successfully! Unity Academy name: Ball3DAcademy Reset Parameters : scale -> 1.0 mass -> 1.0 gravity -> 9.8100004196167


IndexError Traceback (most recent call last)

in 2 3 # Set the default brain to work with ----> 4 default_brain = env.external_brain_names[0] 5 brain = env.brains[default_brain] IndexError: list index out of range

I'm guessing that the Python API has changed since there are no longer any brains. If this is the case - what's the fix? I have absolutely no idea how to train from python code anymore since 0.11.

If I change the env_name to None to learn in the Editor it also doesn't work. After it waits for me to press Play nothing happens (the rest of the code after that doesn't even produce output). And after a while I just get a timeout with "The Unity environment took too long to respond".

chriselion commented 4 years ago

Hi @DVonk, Sorry for the problem. You're correct that the notebook is out of date.

If you run

env.step()

after creating the UnityEnvironment, the brain information will be synced and env.external_brain_names will be non-empty.

We'll make sure the notebook gets tested more automatically in the future, to prevent things like this.

DVonk commented 4 years ago

Great, thank you. By the way - are you planning on providing a notebook that does some actual training in the future? I vaguely remember there existing one for PPO at some point, but I can't find it anymore.

chriselion commented 4 years ago

We don't have any plans to do training in notebooks.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had activity in the last 14 days. It will be closed in the next 14 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically closed because it has not had activity in the last 28 days. If this issue is still valid, please ping a maintainer. Thank you for your contributions.

github-actions[bot] commented 3 years ago

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.