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

Question mlagents Nothing is working (python)

Discussion in 'ML-Agents' started by Mauznemo, Jan 3, 2023.

  1. Mauznemo

    Mauznemo

    Joined:
    Jan 29, 2022
    Posts:
    1
    I tried installing everything needed, followed the docs.
    1. it says install python 3.7.2 or Higher. So I installed 3.10.9 (it was the lowest i could find).
    2. I tried installing PyTorch with "pip3 install torch~=1.7.1 -f https://download.pytorch.org/whl/torch_stable.html" than i got the first error[*1] it said there is now version 1.7 so I installed 1.11.0 (the lowest) this worked.
    3. than I used "pip install mlagents==0.30.0" how the docs said and got an error[*2] again so I installed 0.28.0 (the newest I could find) and it worked.
    4. than I tried "mlagents-learn --help" to check if everything works but it didn't I got an error[*3] again. And this time I have no idea how to fix it.
    Now I don't know what to do is this all just a buggy outdated mess or am I doing something wrong? I also have like 50 Errors in unity after Importing the example project but I think I can fix them.
    (Im using Win 11 and I also tried python 3.11)


    [*1]
    ERROR: Could not find a version that satisfies the requirement torch~=1.7.1 (from versions: 1.11.0, 1.11.0+cpu, 1.11.0+cu113, 1.11.0+cu115, 1.12.0, 1.12.0+cpu, 1.12.0+cu113, 1.12.0+cu116, 1.12.1, 1.12.1+cpu, 1.12.1+cu113, 1.12.1+cu116, 1.13.0, 1.13.0+cpu, 1.13.0+cu116, 1.13.0+cu117, 1.13.1, 1.13.1+cpu, 1.13.1+cu116, 1.13.1+cu117)
    ERROR: No matching distribution found for torch~=1.7.1



    [*2]
    ERROR: Ignored the following versions that require a different python version: 0.10.0.dev0 Requires-Python >=3.6,<3.7; 0.29.0 Requires-Python >=3.7.2,<3.10.0; 0.30.0 Requires-Python >=3.8.13,<=3.10.8; 0.5.0 Requires-Python >=3.6,<3.7; 0.6.0 Requires-Python >=3.6,<3.7; 0.7.0 Requires-Python >=3.6,<3.7; 0.8.0 Requires-Python >=3.6,<3.7; 0.8.1 Requires-Python >=3.6,<3.7; 0.8.2 Requires-Python >=3.6,<3.7; 0.9.0 Requires-Python >=3.6,<3.7; 0.9.1 Requires-Python >=3.6,<3.7; 0.9.2 Requires-Python >=3.6,<3.7; 0.9.3 Requires-Python >=3.6,<3.7
    ERROR: Could not find a version that satisfies the requirement mlagents==0.30.0 (from versions: 0.4.0, 0.10.0.dev1, 0.10.0, 0.10.1, 0.11.0.dev0, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.17.0, 0.18.0, 0.18.1, 0.19.0, 0.20.0, 0.21.0, 0.21.1, 0.22.0, 0.23.0, 0.24.0, 0.24.1, 0.25.0, 0.25.1, 0.26.0, 0.27.0, 0.28.0)
    ERROR: No matching distribution found for mlagents==0.30.0


    [*3]

    (venv) D:\Programme\Unity\AiCat>mlagents-learn --help
    Traceback (most recent call last):
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
    File "D:\Programme\Unity\AiCat\venv\Scripts\mlagents-learn.exe\__main__.py", line 4, in <module>
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\mlagents\trainers\learn.py", line 2, in <module>
    from mlagents import torch_utils
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\mlagents\torch_utils\__init__.py", line 1, in <module>
    from mlagents.torch_utils.torch import torch as torch # noqa
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\mlagents\torch_utils\torch.py", line 6, in <module>
    from mlagents.trainers.settings import TorchSettings
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\mlagents\trainers\settings.py", line 644, in <module>
    class TrainerSettings(ExportableSettings):
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\mlagents\trainers\settings.py", line 667, in TrainerSettings
    cattr.register_structure_hook(
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\cattr\converters.py", line 207, in register_structure_hook
    self._structure_func.register_cls_list([(cl, func)])
    File "D:\Programme\Unity\AiCat\venv\lib\site-packages\cattr\dispatch.py", line 55, in register_cls_list
    self._single_dispatch.register(cls, handler)
    File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\functools.py", line 856, in register
    raise TypeError(
    TypeError: Invalid first argument to `register()`. typing.Dict[mlagents.trainers.settings.RewardSignalType, mlagents.trainers.settings.RewardSignalSettings] is not a class.
     
  2. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    175
    Per *2, you need python <=3.10.8. "0.30.0 Requires-Python >=3.8.13,<=3.10.8". 0.30.0 is the latest verson. Thats the one you want.
     
    Ham-Dongki likes this.
  3. crawfis

    crawfis

    Joined:
    Jan 30, 2014
    Posts:
    97
    Can someone explain WHY? Is Python that bad that it causes breaking changes? Or is Unity the culprit?
     
  4. hughperkins

    hughperkins

    Joined:
    Dec 3, 2022
    Posts:
    175