Search Unity

Error when training ML-agents Penguin Tutorial: Environment stopping

Discussion in 'ML-Agents' started by mqc410872027, Apr 10, 2020.

  1. mqc410872027

    mqc410872027

    Joined:
    Apr 6, 2020
    Posts:
    1
    Hi
    I am very new to this and just started to follow the ml-agents: penguins.
    After I started training (by entering the command in Anaconda Prompt) and pressed the playing button in the Unity Editor, it gives me below error:

    (ml-agents) PS C:\Users\41087> cd "G:\Project Genesis\ml-agents-master\ml-agents-0.13.1\ml-agents-0.13.1"
    (ml-agents) PS G:\Project Genesis\ml-agents-master\ml-agents-0.13.1\ml-agents-0.13.1> mlagents-learn config/trainer_config.yaml --curriculum config/curricula/penguin --run-id penguin_01 --train
    WARNING:tensorflow:From C:\Users\41087\Anaconda3\envs\ml-agents\lib\site-packages\tensorflow_core\python\compat\v2_compat.py:65: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
    Instructions for updating:
    non-resource variables are not supported in the long term


    ▄▄▄▓▓▓▓
    ╓▓▓▓▓▓▓█▓▓▓▓▓
    ,▄▄▄m▀▀▀' ,▓▓▓▀▓▓▄ ▓▓▓ ▓▓▌
    ▄▓▓▓▀' ▄▓▓▀ ▓▓▓ ▄▄ ▄▄ ,▄▄ ▄▄▄▄ ,▄▄ ▄▓▓▌▄ ▄▄▄ ,▄▄
    ▄▓▓▓▀ ▄▓▓▀ ▐▓▓▌ ▓▓▌ ▐▓▓ ▐▓▓▓▀▀▀▓▓▌ ▓▓▓ ▀▓▓▌▀ ^▓▓▌ ╒▓▓▌
    ▄▓▓▓▓▓▄▄▄▄▄▄▄▄▓▓▓ ▓▀ ▓▓▌ ▐▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▌ ▐▓▓▄ ▓▓▌
    ▀▓▓▓▓▀▀▀▀▀▀▀▀▀▀▓▓▄ ▓▓ ▓▓▌ ▐▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▌ ▐▓▓▐▓▓
    ^█▓▓▓ ▀▓▓▄ ▐▓▓▌ ▓▓▓▓▄▓▓▓▓ ▐▓▓ ▓▓▓ ▓▓▓ ▓▓▓▄ ▓▓▓▓`
    '▀▓▓▓▄ ^▓▓▓ ▓▓▓ └▀▀▀▀ ▀▀ ^▀▀ `▀▀ `▀▀ '▀▀ ▐▓▓▌
    ▀▀▀▀▓▄▄▄ ▓▓▓▓▓▓, ▓▓▓▓▀
    `▀█▓▓▓▓▓▓▓▓▓▌
    ¬`▀▀▀█▓


    Version information:
    ml-agents: 0.13.1,
    ml-agents-envs: 0.13.1,
    Communicator API: API-13,
    TensorFlow: 2.0.1
    INFO:mlagents.trainers:CommandLineOptions(debug=False, num_runs=1, seed=-1, env_path=None, run_id='penguin_01', load_model=False, train_model=True, save_freq=50000, keep_checkpoints=5, base_port=5005, num_envs=1, curriculum_folder='config/curricula/penguin', lesson=0, no_graphics=False, multi_gpu=False, trainer_config_path='config/trainer_config.yaml', sampler_file_path=None, docker_target_name=None, env_args=None, cpu=False, width=84, height=84, quality_level=5, time_scale=20, target_frame_rate=-1)
    INFO:mlagents_envs:Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
    INFO:mlagents.trainers:UnityEnvironment worker 0: environment stopping due to UnityTimeOutException
    INFO:mlagents.trainers:Learning was interrupted. Please wait while the graph is generated.
    INFO:mlagents.trainers:Saved Model
    (ml-agents) PS G:\Project Genesis\ml-agents-master\ml-agents-0.13.1\ml-agents-0.13.1>




    ====================================

    Further investigation determined it is due to UnityTimeOutException error. Could anyone help, much appreciated!!

    Ml-agent version 0.13.1
    Unity 2019.3.8f1
    Barracuda ver 0.4.0
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      68.3 KB
      Views:
      341
  2. TreyK-47

    TreyK-47

    Unity Technologies

    Joined:
    Oct 22, 2019
    Posts:
    1,820
    I'll forward this to the team so they can take a look.
     
  3. WalkLearner

    WalkLearner

    Joined:
    Mar 12, 2020
    Posts:
    10
    If you follow the latest penguin example from this link, you should have the exact version of the environment that the demonstrator has, i.e. ML-agents 0.14.0 and Unity 2018.4.14f1.
     
  4. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    could you print out the debug console from unity as well? I'm not sure what the issue is exactly.
     
  5. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    It looks like the port is wrong in the connection. It should be on port 5004, not 5005.
     
  6. christophergoy

    christophergoy

    Joined:
    Sep 16, 2015
    Posts:
    735
    you can add the --base_port=5004 option when you run the command and it should work