FXCKING PLEASE HELP ME

I’m Korean. So I’m not good at ENGLISH. BUT PLZ HELP ME

Version information:
ml-agents: 0.28.0,
ml-agents-envs: 0.28.0,
Communicator API: 1.5.0,
PyTorch: 1.7.1+cpu
[INFO] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
Traceback (most recent call last):
File “c:\python38\lib\runpy.py”, line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File “c:\python38\lib\runpy.py”, line 87, in run_code
exec(code, run_globals)
File "C:\Python38\Scripts\mlagents-learn.exe_main
.py", line 7, in
File “c:\python38\lib\site-packages\mlagents\trainers\learn.py”, line 260, in main
run_cli(parse_command_line())
File “c:\python38\lib\site-packages\mlagents\trainers\learn.py”, line 256, in run_cli
run_training(run_seed, options, num_areas)
File “c:\python38\lib\site-packages\mlagents\trainers\learn.py”, line 132, in run_training
tc.start_learning(env_manager)
File “c:\python38\lib\site-packages\mlagents_envs\timers.py”, line 305, in wrapped
return func(*args, **kwargs)
File “c:\python38\lib\site-packages\mlagents\trainers\trainer_controller.py”, line 173, in start_learning
self._reset_env(env_manager)
File “c:\python38\lib\site-packages\mlagents_envs\timers.py”, line 305, in wrapped
return func(*args, **kwargs)
File “c:\python38\lib\site-packages\mlagents\trainers\trainer_controller.py”, line 105, in _reset_env
env_manager.reset(config=new_config)
File “c:\python38\lib\site-packages\mlagents\trainers\env_manager.py”, line 68, in reset
self.first_step_infos = self._reset_env(config)
File “c:\python38\lib\site-packages\mlagents\trainers\subprocess_env_manager.py”, line 446, in _reset_env
ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})
File “c:\python38\lib\site-packages\mlagents\trainers\subprocess_env_manager.py”, line 101, in recv
raise env_exception
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 Agents’ Behavior Parameters > Behavior Type is set to “Default”
The environment and the Python interface have compatible versions.
If you’re running on a headless server without graphics support, turn off display by either passing --no-graphics option or build your Unity executable as server build.

why It doesn’t work.

Does your Behavior Name on the Agent match your training config file?

same problem here

I’ve encountered a noteworthy behavior when training with ML-Agents in Unity 2021, using Python 3.8. Despite receiving similar script errors, I realized that they might not be affecting the training process. These errors seemed to persist even when I paused the script after surpassing the expected timeframe set by ml-agents-learn.

Initially, it appeared that learning was not occurring, especially since Unity would pause whenever it lost focus, which was confirmed by the absence of updates until the 10,000-step mark. To address this, I updated my Unity settings to allow training to proceed even when the Unity Editor is not the active window.

Here’s what I did to fix the issue:

In the Unity Editor, I navigated to Edit → Project Settings → Player.
Under the ‘Resolution and Presentation’ tab, within the ‘Resolution’ section, I checked the ‘Run In Background’ option.

Now, Unity doesn’t stop the training if I switch windows, which means I can alternate between Unity and TensorBoard or other prompts without interrupting the ML training process.

1 Like