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

invalid literal for int() with base 10: 'BehaviourName?team=TeamID' #6159

Open
lixtheyt opened this issue Oct 11, 2024 · 0 comments
Open

invalid literal for int() with base 10: 'BehaviourName?team=TeamID' #6159

lixtheyt opened this issue Oct 11, 2024 · 0 comments
Labels
bug Issue describes a potential bug in ml-agents.

Comments

@lixtheyt
Copy link

Describe the bug
Hello! I am trying to add ML-Agents to my Unity Project and I ran into an issue. When ever I tried to use mlagents-learn and then clicked Play in Unity Editor I've got error like this:

C:\Users\Lix\Secret\venv\lib\site-packages\torch\__init__.py:696: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\tensor\python_tensor.cpp:453.)
  _C._set_default_tensor_type(t)

 [BIG ASCII UNITY LOGO]

 Version information:
  ml-agents: 0.30.0,
  ml-agents-envs: 0.30.0,
  Communicator API: 1.5.0,
  PyTorch: 2.2.2+cu121
C:\Users\Lix\Secret\venv\lib\site-packages\torch\__init__.py:696: UserWarning: torch.set_default_tensor_type() is deprecated as of PyTorch 2.1, please use torch.set_default_dtype() and torch.set_default_device() as alternatives. (Triggered internally at C:\actions-runner\_work\pytorch\pytorch\builder\windows\pytorch\torch\csrc\tensor\python_tensor.cpp:453.)
  _C._set_default_tensor_type(t)
[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.3.0-exp.3 and communication version 1.5.0
[ERROR] UnityEnvironment worker 0: environment raised an unexpected exception.
Traceback (most recent call last):
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 211, in worker
    env.reset()
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents_envs\environment.py", line 323, in reset
    self._update_behavior_specs(outputs)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents_envs\environment.py", line 292, in _update_behavior_specs
    agent_infos = output.rl_output.agentInfos[int(brain_param.brain_name)]
ValueError: invalid literal for int() with base 10: 'Daisy?team=0'
Traceback (most recent call last):
  File "C:\Users\Lix\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\Lix\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\Lix\Secret\venv\Scripts\mlagents-learn.exe\__main__.py", line 7, in <module>
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\learn.py", line 264, in main
    run_cli(parse_command_line())
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\learn.py", line 260, in run_cli
    run_training(run_seed, options, num_areas)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\learn.py", line 136, in run_training
    tc.start_learning(env_manager)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents_envs\timers.py", line 305, in wrapped
    return func(*args, **kwargs)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\trainer_controller.py", line 172, in start_learning
    self._reset_env(env_manager)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents_envs\timers.py", line 305, in wrapped
    return func(*args, **kwargs)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\trainer_controller.py", line 105, in _reset_env
    env_manager.reset(config=new_config)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\env_manager.py", line 68, in reset
    self.first_step_infos = self._reset_env(config)
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 446, in _reset_env
    ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})
  File "C:\Users\Lix\Secret\venv\lib\site-packages\mlagents\trainers\subprocess_env_manager.py", line 101, in recv
    raise env_exception
ValueError: invalid literal for int() with base 10: 'Daisy?team=0'

Environment (please complete the following information):

  • Unity Version: Unity 2022.3.37f1
  • OS + version: Windows 11
  • ML-Agents version: ML-Agents 2.1
  • Torch version: 2.2.2+cu121
  • Environment: venv
  • Python Version: 3.9.13
@lixtheyt lixtheyt added the bug Issue describes a potential bug in ml-agents. label Oct 11, 2024
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

1 participant