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.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    Dismiss Notice

WARNING: The communication API versions between Unity and python differ at the minor version level

Discussion in 'ML-Agents' started by rufimelo99, Jan 2, 2021.

  1. rufimelo99

    rufimelo99

    Joined:
    Dec 11, 2020
    Posts:
    2
    Hello..
    I'm trying to train an agent with selfplay();
    I installed the last version at the moment: https://github.com/Unity-Technologies/ml-agents/releases/tag/release_12.
    When I try to run, i have these warnings:


    WARNING: The communication API versions between Unity and python differ at the minor version level. Python API: 1.3.0, Unity API: 1.0.0 Python Library Version: 0.23.0 .
    This means that some features may not work unless you upgrade the package with the lower version.Please find the versions that work best together from our release page.

    Python package version (0.23.0) is out of the supported range or not from an official release. It is strongly recommended that you use a Python package between 0.16.1 and 0.20.0. Training will proceed, but the output format may be different.
    UnityEngine.Debug:LogWarningFormat (string,object[])

    My agent stops acting somehow and I don't know if it could be due to this.
    I don't know what should I do to fix it.
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      107.8 KB
      Views:
      310
    • 2.PNG
      2.PNG
      File size:
      96.5 KB
      Views:
      300
  2. mbaske

    mbaske

    Joined:
    Dec 31, 2017
    Posts:
    473
    I just got a similar message.
    WARNING: The communication API versions between Unity and python differ at the minor version level. Python API: 1.3.0, Unity API: 1.2.0 Python Library Version: 0.23.0 .
    This means that some features may not work unless you upgrade the package with the lower version.Please find the versions that work best together from our release page.

    Looks like the version info in Academy.cs doesn't match.

    const string k_ApiVersion = "1.2.0";
    internal const string k_PackageVersion = "1.6.0-preview";

    My manifest.json lists a dependency to
    "com.unity.ml-agents": "1.6.0-preview",
     
    rufimelo99 likes this.
  3. rufimelo99

    rufimelo99

    Joined:
    Dec 11, 2020
    Posts:
    2
    First of all, ty for replying. Should I try other ml-agent release or?

    Edited:
    I'm trying release 5 at the moment.. seems fine at least
    ty once again
     
    Last edited: Jan 2, 2021
  4. ervteng_unity

    ervteng_unity

    Unity Technologies

    Joined:
    Dec 6, 2018
    Posts:
    150
    I think both of these issues are caused by upgrading the Python package without upgrading the respective Unity package. There are two version numbers: the ones listed as "Python/Unity API" is the version of the communication protocol between Unity and Python, and "Package Version" is the version of the Unity package that is installed. Only the communication version needs to match. I think in both these cases the error should be resolved by updating ML-Agents in the Unity editor to the latest 1.7.2.

    In many cases training should proceed just fine, unless you're trying to use new features (e.g. hybrid actions) that weren't found in older releases.
     
    mbaske likes this.
  5. jfhauris3

    jfhauris3

    Joined:
    Dec 16, 2020
    Posts:
    1
    Since updated ml-agents version to 1.7.2 am now having same issue:
    please help, do not know what to try next.

    Version information:
    ml-agents: 0.22.0,
    ml-agents-envs: 0.22.0,
    Communicator API: 1.2.0,
    PyTorch: 1.7.0+cu110
    2021-02-04 15:44:20 INFO [learn.py:275] run_seed set to 7748
    2021-02-04 15:44:22 INFO [environment.py:205] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
    2021-02-04 15:44:31 WARNING [environment.py:104] WARNING: The communication API versions between Unity and python differ at the minor version level. Python API: 1.2.0, Unity API: 1.3.
    This means that some features may not work unless you upgrade the package with the lower version.Please find the versions that work best together from our release page.
    https://github.com/Unity-Technologies/ml-agents/releases
    2021-02-04 15:45:31 INFO [subprocess_env_manager.py:184] UnityEnvironment worker 0: environment stopping.
    2021-02-04 15:45:31 INFO [trainer_controller.py:85] Saved Model
    Traceback (most recent call last):
    File "C:\Program Files\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
    File "C:\Program Files\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
    File "C:\Users\jon.f.hauris\python-envs\focus\Scripts\mlagents-learn.exe\__main__.py", line 7, in <module>
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\learn.py", line 280, in main
    run_cli(parse_command_line())
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\learn.py", line 276, in run_cli
    run_training(run_seed, options)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\learn.py", line 153, in run_training
    tc.start_learning(env_manager)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents_envs\timers.py", line 305, in wrapped
    return func(*args, **kwargs)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\trainer_controller.py", line 174, in start_learning
    self._reset_env(env_manager)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents_envs\timers.py", line 305, in wrapped
    return func(*args, **kwargs)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\trainer_controller.py", line 109, in _reset_env
    env_manager.reset(config=new_config)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\env_manager.py", line 66, in reset
    self.first_step_infos = self._reset_env(config)
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 290, in _reset_env
    ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})
    File "c:\users\jon.f.hauris\python-envs\focus\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 91, 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.