Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[Solved] Unable to train the example environment

Discussion in 'ML-Agents' started by Xinzz, Apr 1, 2020.

  1. Xinzz

    Xinzz

    Joined:
    Jun 28, 2015
    Posts:
    67
    I have closely follow the installation guide, but still when i type'mlagents-learn config/trainer_config.yaml --run-id=firstRun --train', it appears:

    D:\ml-agents-0.15.1>mlagents-learn config/trainer_config.yaml --run-id=firstRun --train
    WARNING:tensorflow:From d:\python\unityml\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.15.1,
    ml-agents-envs: 0.15.1,
    Communicator API: 0.15.0,
    TensorFlow: 2.0.1
    WARNING:tensorflow:From d:\python\unityml\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
    Process Process-1:
    Traceback (most recent call last):
    File "D:\Python\Python37\lib\multiprocessing\process.py", line 297, in _bootstrap
    self.run()
    File "D:\Python\Python37\lib\multiprocessing\process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
    File "d:\ml-agents-0.15.1\ml-agents\mlagents\trainers\subprocess_env_manager.py", line 98, in worker
    worker_id, [shared_float_properties, engine_configuration_channel]
    File "d:\ml-agents-0.15.1\ml-agents\mlagents\trainers\learn.py", line 444, in create_unity_environment
    side_channels=side_channels,
    File "d:\ml-agents-0.15.1\ml-agents-envs\mlagents_envs\environment.py", line 143, in __init__
    aca_output = self.send_academy_parameters(rl_init_parameters_in)
    File "d:\ml-agents-0.15.1\ml-agents-envs\mlagents_envs\environment.py", line 558, in send_academy_parameters
    return self.communicator.initialize(inputs)
    File "d:\ml-agents-0.15.1\ml-agents-envs\mlagents_envs\rpc_communicator.py", line 98, in initialize
    self.poll_for_timeout()
    File "d:\ml-agents-0.15.1\ml-agents-envs\mlagents_envs\rpc_communicator.py", line 91, in poll_for_timeout
    "The Unity environment took too long to respond. Make sure that :\n"
    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 are linked to the appropriate Brains
    The environment and the Python interface have compatible versions.
    2020-04-01 21:45:14 INFO [trainer_controller.py:104] Learning was interrupted. Please wait while the graph is generated.
    2020-04-01 21:45:14 INFO [trainer_controller.py:100] Saved Model
    2020-04-01 21:45:14 WARNING [learn.py:343] Unable to save to ./summaries/firstRun_timers.json. Make sure the directory exists

    In unity editor, shows 'Couldn't connect to trainer on port 5004 using API version 0.15.0.'

    any helps please? Thanks
     
  2. Xinzz

    Xinzz

    Joined:
    Jun 28, 2015
    Posts:
    67
    Never mind, problem solved, the 0.15.0 communicator api has problem, i solved it by downgrading to 0.14.1.
     
  3. nmtrox

    nmtrox

    Joined:
    Apr 5, 2020
    Posts:
    2
    How were you able to downgrade just the communicator api?
     
  4. Xinzz

    Xinzz

    Joined:
    Jun 28, 2015
    Posts:
    67
unityunity