Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question FXCKING PLEASE HELP ME

Discussion in 'ML-Agents' started by Sejin0730, Jul 16, 2023.

  1. Sejin0730

    Sejin0730

    Joined:
    Jul 16, 2023
    Posts:
    1
    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 <module>
    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.
     
  2. Energymover

    Energymover

    Joined:
    Mar 28, 2023
    Posts:
    33
    Does your Behavior Name on the Agent match your training config file?
     
  3. InquisitorTR

    InquisitorTR

    Joined:
    Nov 28, 2022
    Posts:
    3
    same problem here
     
  4. Karbinee

    Karbinee

    Joined:
    Jan 27, 2024
    Posts:
    1
    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.
     
    MediaGiant likes this.