When you go to the ml-agent/notebooks/directory
there are two notebook files.
getting-started-gym.ipynb
and
getting-started.ipynb
.
I can get the gym environment to run correctly, where it asks you to hit play on unity and runs, but not the other one. What is the difference between the two? Any guesses why the non-gym environment wont run? Can I only control Unity using python gym environment?
The problem starts when running the Start Environment section of getting-started.ipynb
I do not receive any notification to hit Play in Unity. Once that block of code times out i get.
UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
The environment does not need user interaction to launch
The Agents are linked to the appropriate Brains
The environment and the Python interface have compatible versions.
I did set env_name = None
which seems to work for the OpenAiGym notebook, but not this one.
I’ll flag this for the team to check out.
What version of ml-agents are you using? We deprecated the notebooks in our most recent release. It is possible that the message prompting you to press play in the editor did not go through, but Python is still waiting for it. Maybe press play in the editor regardless and see if it works. Alternatively, you can use an executable to start the training, this way you will not need to interact with the editor.
Using MLAgent Version 0.15.1
I’m not sure if maybe I’m doing something wrong but the code I’m trying to run is.
engine_configuration_channel = EngineConfigurationChannel()
env = UnityEnvironment(file_name=env_name, side_channels = [engine_configuration_channel])
#env = UnityEnv(env_name, worker_id=0, use_visual=True, multiagent=True)
#Reset the environment
env.reset()
# Set the default brain to work with
group_name = env.get_agent_groups()[0]
group_spec = env.get_agent_group_spec(group_name)
# Set the time scale of the engine
engine_configuration_channel.set_configuration_parameters(time_scale = 3.0)
After running that, the code block stalls for a bit before giving me the following error.
UnityTimeOutException: The Unity environment took too long to respond. Make sure that :
The environment does not need user interaction to launch
The Agents are linked to the appropriate Brains
The environment and the Python interface have compatible versions.
.
I did try to just run Unity anyways, but with no luck. I’m new to working with MLAgent and python so I may be missing something simpe. I did set the env_name to None.
When you say “We deprecated the notebooks in our most recent release”, do you mean you Jupyter Notebook will not be supported?
I miss-spoke, the notebooks will be deprecated in the next release but we will still support the use of UnityEnvironment. (We did not manage to integrate the notebooks in our testing framework)
Your error is rather strange (even stranger that it works with the gym wrapper) When passing an executable path, there should not be any missed timing since Python launches the environment.
Looking at the FAQ, ml-agents/docs/FAQ.md at main · Unity-Technologies/ml-agents · GitHub, there could also be an issue with HTTP_PROXY and HTTPS_PROXY values in your environment variables