Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Crash when launching mlagnets-learn

Discussion in 'ML-Agents' started by qwertyuiop098765432, Mar 29, 2024.

  1. qwertyuiop098765432

    qwertyuiop098765432

    Joined:
    Aug 30, 2020
    Posts:
    1
    As soon as I start the scene it crashes, I don't know why, the mlagents-learn version matches the package version.

    mlagents-learn --resume


    ┐ ╖

    ╓╖╬│╡ ││╬╖╖

    ╓╖╬│││││┘ ╬│││││╬╖

    ╖╬│││││╬╜ ╙╬│││││╖╖ ╗╗╗

    ╬╬╬╬╖││╦╖ ╖╬││╗╣╣╣╬ ╟╣╣╬ ╟╣╣╣ ╜╜╜ ╟╣╣

    ╬╬╬╬╬╬╬╬╖│╬╖╖╓╬╪│╓╣╣╣╣╣╣╣╬ ╟╣╣╬ ╟╣╣╣ ╒╣╣╖╗╣╣╣╗ ╣╣╣ ╣╣╣╣╣╣ ╟╣╣╖ ╣╣╣

    ╬╬╬╬┐ ╙╬╬╬╬│╓╣╣╣╝╜ ╫╣╣╣╬ ╟╣╣╬ ╟╣╣╣ ╟╣╣╣╙ ╙╣╣╣ ╣╣╣ ╙╟╣╣╜╙ ╫╣╣ ╟╣╣

    ╬╬╬╬┐ ╙╬╬╣╣ ╫╣╣╣╬ ╟╣╣╬ ╟╣╣╣ ╟╣╣╬ ╣╣╣ ╣╣╣ ╟╣╣ ╣╣╣┌╣╣╜

    ╬╬╬╜ ╬╬╣╣ ╙╝╣╣╬ ╙╣╣╣╗╖╓╗╣╣╣╜ ╟╣╣╬ ╣╣╣ ╣╣╣ ╟╣╣╦╓ ╣╣╣╣╣

    ╙ ╓╦╖ ╬╬╣╣ ╓╗╗╖ ╙╝╣╣╣╣╝╜ ╘╝╝╜ ╝╝╝ ╝╝╝ ╙╣╣╣ ╟╣╣╣

    ╩╬╬╬╬╬╬╦╦╬╬╣╣╗╣╣╣╣╣╣╣╝ ╫╣╣╣╣

    ╙╬╬╬╬╬╬╬╣╣╣╣╣╣╝╜

    ╙╬╬╬╣╣╣╜





    Version information:

    ml-agents: 0.30.0,

    ml-agents-envs: 0.30.0,

    Communicator API: 1.5.0,

    PyTorch: 1.11.0

    [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 "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/subprocess_env_manager.py", line 211, in worker

    env.reset()

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents_envs/environment.py", line 323, in reset

    self._update_behavior_specs(outputs)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents_envs/environment.py", line 292, in _update_behavior_specs

    agent_infos = output.rl_output.agentInfos[brain_param.brain_name]

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/google/protobuf/internal/containers.py", line 70, in __getitem__

    return self._values[key]

    TypeError: list indices must be integers or slices, not str

    Traceback (most recent call last):

    File "/Users/ivan/MLAgents/venv/bin/mlagents-learn", line 8, in <module>

    sys.exit(main())

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/learn.py", line 264, in main

    run_cli(parse_command_line())

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/learn.py", line 260, in run_cli

    run_training(run_seed, options, num_areas)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/learn.py", line 136, in run_training

    tc.start_learning(env_manager)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents_envs/timers.py", line 305, in wrapped

    return func(*args, **kwargs)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/trainer_controller.py", line 172, in start_learning

    self._reset_env(env_manager)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents_envs/timers.py", line 305, in wrapped

    return func(*args, **kwargs)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/trainer_controller.py", line 105, in _reset_env

    env_manager.reset(config=new_config)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/env_manager.py", line 68, in reset

    self.first_step_infos = self._reset_env(config)

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/subprocess_env_manager.py", line 446, in _reset_env

    ew.previous_step = EnvironmentStep(ew.recv().payload, ew.worker_id, {}, {})

    File "/Users/ivan/MLAgents/venv/lib/python3.9/site-packages/mlagents/trainers/subprocess_env_manager.py", line 101, in recv

    raise env_exception

    TypeError: list indices must be integers or slices, not str