Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

StrictVersion has no attribute 'version'

Discussion in 'ML-Agents' started by mmmbop, Apr 14, 2022.

  1. mmmbop

    mmmbop

    Joined:
    Jan 22, 2022
    Posts:
    20
    Hello , im trying to start training, but got this error in console and "Couldnt connect to trainer using API version 1.5.0" Unity Console.

    At first it connected, but after 2 minutes worker is restarting and raise error

    Version information:
    ml-agents: 0.28.0,
    ml-agents-envs: 0.28.0,
    Communicator API: 1.5.0,
    PyTorch: 1.7.1+cu110


    [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: Walker?team=0

    ===Hyperparameters ====


    Code (CSharp):
    1. [WARNING] Restarting worker[0] after 'The Unity environment took too long to respond. Make sure that :
    2.         The environment does not need user interaction to launch
    3.         The Agents' Behavior Parameters > Behavior Type is set to "Default"
    4.          The environment and the Python interface have compatible versions.
    5.          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.'
    6. [INFO] Listening on port 5004. Start training by pressing the Play button in the Unity Editor.
    7. [ERROR] UnityEnvironment worker 0: environment raised an unexpected exception.
    8. Traceback (most recent call last):
    9.   File "C:\Users\Antigr\python-envs\sample-env\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 163, in worker
    10.     env = env_factory(worker_id, side_channels)
    11.   File "C:\Users\Antigr\python-envs\sample-env\lib\site-packages\mlagents\trainers\learn.py", line 192, in create_unity_environment
    12.     log_folder=log_folder,
    13.   File "C:\Users\Antigr\python-envs\sample-env\lib\site-packages\mlagents_envs\environment.py", line 245, in __init__
    14.     aca_params.package_version,
    15.   File "C:\Users\Antigr\python-envs\sample-env\lib\site-packages\mlagents_envs\environment.py", line 96, in _check_communication_compatibility
    16.     if unity_communicator_version.version[0] == 0:
    17. AttributeError: 'StrictVersion' object has no attribute 'version'
    18. [INFO] Exported results\legs\Walker\Walker-0.onnx
    19. [INFO] Copied results\legs\Walker\Walker-0.onnx to results\legs\Walker.onnx.
    20. Traceback (most recent call last):
    21.   === Another long traceback ===
    22. File "C:\Users\Antigr\python-envs\sample-env\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 446, in _reset_env
    23.     ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})
    24.   File "C:\Users\Antigr\python-envs\sample-env\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 101, in recv
    25.     raise env_exception
    26. AttributeError: 'StrictVersion' object has no attribute 'version'
     
  2. fabhiansan

    fabhiansan

    Joined:
    Feb 26, 2022
    Posts:
    1
    I'm having the same trouble
     
  3. WalterCoding

    WalterCoding

    Joined:
    Feb 9, 2021
    Posts:
    1
    same problem here
     
  4. Ch1ckenNug

    Ch1ckenNug

    Joined:
    Sep 14, 2021
    Posts:
    8
    Has anybody found a fix?
     
  5. Cichy_93

    Cichy_93

    Joined:
    Jul 7, 2015
    Posts:
    1
    I had the same problem when I was following "MLAgents: Hummingbirds" tutorial. After launching the learning process, the Agents were moving but after some time, Unity froze and got the errors.

    This solution worked for me:
    https://forum.unity.com/threads/war...ook-too-long-to-respond.1292478/#post-8335542

    "go to Edit -> Project Settings -> Player, and tick "Run In Background""

    After that, I no longer have freezes and errors. Anaconda Prompt also started to print the learning progress (as it should):
    [INFO] Hummingbird. Step: 10000. Time Elapsed: 53.456 s. Mean Reward: -2.375. Std of Reward: 5.566. Training.
     
    Vellyxenya likes this.