Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run mlagents-learn after installation #6150

Open
Scrobotic opened this issue Sep 24, 2024 · 1 comment
Open

Can't run mlagents-learn after installation #6150

Scrobotic opened this issue Sep 24, 2024 · 1 comment
Labels
bug Issue describes a potential bug in ml-agents.

Comments

@Scrobotic
Copy link

Scrobotic commented Sep 24, 2024

I installed the python package mlagents and it didn't show any errors. However, when i try to run ml-agents I get some errors and I dont know how to fix them...

Console logs / stack traces

Traceback (most recent call last):
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.2800.0_x64__qbz5n2kfra8p0\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Scrobotic\abc\venv\Scripts\mlagents-learn.exe\__main__.py", line 4, in <module>
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents\trainers\learn.py", line 2, in <module>
    from mlagents import torch_utils
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents\torch_utils\__init__.py", line 1, in <module>
    from mlagents.torch_utils.torch import torch as torch  # noqa
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents\torch_utils\torch.py", line 6, in <module>
    from mlagents.trainers.settings import TorchSettings
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents\trainers\settings.py", line 25, in <module>
    from mlagents.trainers.cli_utils import StoreConfigFile, DetectDefault, parser
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents\trainers\cli_utils.py", line 5, in <module>
    from mlagents_envs.environment import UnityEnvironment
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents_envs\environment.py", line 12, in <module>
    from mlagents_envs.side_channel.side_channel import SideChannel
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents_envs\side_channel\__init__.py", line 5, in <module>
    from mlagents_envs.side_channel.default_training_analytics_side_channel import (  # noqa
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents_envs\side_channel\default_training_analytics_side_channel.py", line 7, in <module>
    from mlagents_envs.communicator_objects.training_analytics_pb2 import (
  File "c:\users\scrobotic\abc\venv\lib\site-packages\mlagents_envs\communicator_objects\training_analytics_pb2.py", line 35, in <module>
    _descriptor.FieldDescriptor(
  File "c:\users\scrobotic\abc\venv\lib\site-packages\google\protobuf\descriptor.py", line 621, in __new__
    _message.Message._CheckCalledFromGeneratedFile()
TypeError: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

Environment (please complete the following information):

  • Unity Version: Unity 2022.3.47f1
  • OS + version: Windows 11
  • ML-Agents version: 0.29.0
  • Torch version: 1.7.0+cu110
@Scrobotic Scrobotic added the bug Issue describes a potential bug in ml-agents. label Sep 24, 2024
@Scrobotic Scrobotic changed the title Can't run ml-agents after installation Can't run mlagents-learn after installation Sep 24, 2024
@KamuiSW
Copy link

KamuiSW commented Oct 9, 2024

have you tried doing what the log suggestd? :D

If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue describes a potential bug in ml-agents.
Projects
None yet
Development

No branches or pull requests

2 participants