Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[WARNING] Restarting worker[0] after The Unity environment took too long to respond.

Discussion in 'ML-Agents' started by MaxxRafen, Jun 7, 2022.

  1. MaxxRafen

    MaxxRafen

    Joined:
    Apr 7, 2014
    Posts:
    27
    Trying to set up ML agents for my current project. I've worked with ML agents and had everything running, but this was about a year ago and everything has received updates since.

    Currently, It acts like it's going to start learning, says "Listening on port 5004. Start training by pressing the Play button in the Unity Editor". Doing so gets it to assign a default config and attempt to start training, but after about 30 seconds it gives up with:
    [WARNING] Restarting worker[0] after The Unity environment took too long to respond.

    My behavior is set to default and I think the communications API and environment are compatible versions, though I've had a hard time trying to understand which two need to be compatible...


    Version information:
    ml-agents: 0.29.0,
    ml-agents-envs: 0.29.0,
    Communicator API: 1.5.0,
    PyTorch: 1.8.2+cu111
    [INFO] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
    [INFO] Connected to Unity environment with package version 2.0.1 and communication version 1.5.0
    [INFO] Connected new brain: FlyAction?team=0
    [WARNING] Behavior name FlyAction does not match any behaviors specified in the trainer configuration file. A default configuration will be used.
    [WARNING] Deleting TensorBoard data events.out.tfevents.1654629292.DESKTOP-0KGI2LE.32684.0 that was left over from a previous run.


    I'm assuming the versions that need to match are Communicator API and Communication Version, both of which are 1.5.0 in my case.

    I've looked around for hours now trying to figure this out, and reinstalled phython, pytorch, and mlagents multiple times to various versions without any forward progress (there was some backwards progress, though).

    Please help!
     
  2. MaxxRafen

    MaxxRafen

    Joined:
    Apr 7, 2014
    Posts:
    27
    Oh, here's the error output as well:

    [WARNING] Restarting worker[0] after '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.'
     
  3. MaxxRafen

    MaxxRafen

    Joined:
    Apr 7, 2014
    Posts:
    27
    I should mention that my GPU is not NVIDIA, and I'm starting to suspect this may be the issue with more recent versions of ML-Agents. (It worked before with this same GPU)
     
  4. ntroncoso05

    ntroncoso05

    Joined:
    Oct 12, 2021
    Posts:
    1
    Hi Maxx,
    I had a similar situation it was solve by Edit -> Project Settings -> Player, and tick "Run In Background", I could not check the anaconda prompt (or any other windows) while in play mode because unity paused/freezes the run and caused the error. hope this can help you. btw, my GPU is NVidia, don't know if makes any difference
     
    Cichy_93 likes this.
  5. goldenp

    goldenp

    Joined:
    Jun 29, 2022
    Posts:
    3
    This can occur when the behaviour name in the behavior parameters doesn't match the behavior name in the training configuration yaml file.
     
  6. mmmbop

    mmmbop

    Joined:
    Jan 22, 2022
    Posts:
    20
    Behavior name FlyAction does not match any behaviors specified in the trainer configuration file. A default configuration will be used

    Your name is behavior parameters script and inside yaml file must match
     
  7. KandepateJohnson

    KandepateJohnson

    Joined:
    Mar 4, 2022
    Posts:
    2
    i have create a simple project which moves the agent to goal , only difficulty i find is once i start training and run the unity everything goes well ,and then if i stop unity , the learning is getting restarted again in the terminal these are the errors i get

    upload_2022-12-11_11-26-38.jpeg


    upload_2022-12-11_11-26-48.jpeg
    upload_2022-12-11_11-26-57.jpeg
    i have added the behavior name as MoveToGoal in the agent in unity. I feel i need to change something in the config file to stop restarting it.


    Can anyone help me in this?
     

    Attached Files: