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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Question Having trouble with the mlagents-learn command. ml-agents release 18, package 2.1.0

Discussion in 'ML-Agents' started by IronGrimoire, Dec 10, 2021.

  1. IronGrimoire

    IronGrimoire

    Joined:
    Jun 11, 2016
    Posts:
    3
    I have been following along with the "Making a New Learning Environment" documentation tutorial at - https://github.com/Unity-Technologi..._docs/docs/Learning-Environment-Create-New.md

    I get close to the end - the step where I enter the command:
    mlagents-learn path/rollerball_config.yaml --run-id=RollerBall

    I get the error:
    mlagents.trainers.exception.TrainerConfigError: The option behaviors was specified in your YAML file, but is invalid.

    Which I find a little odd due to the "" symbols, like it can't say exactly which option it doesn't like.
    I am using the file contents given in the tutorial's YAML file:
    Code (YAML):
    1.  
    2. behaviors:
    3.   RollerBall:
    4.    trainer_type: ppo
    5.    hyperparameters:
    6.      batch_size: 10
    7.      buffer_size: 100
    8.      learning_rate: 3.0e-4
    9.      beta: 5.0e-4
    10.      epsilon: 0.2
    11.      lambd: 0.99
    12.      num_epoch: 3
    13.      learning_rate_schedule: linear
    14.    network_settings:
    15.      normalize: false
    16.      hidden_units: 128
    17.      num_layers: 2
    18.    reward_signals:
    19.      extrinsic:
    20.        gamma: 0.99
    21.        strength: 1.0
    22.    max_steps: 500000
    23.    time_horizon: 64
    24.    summary_freq: 10000
    25.  
    Can anyone point me in the right direction or have any ideas on what I can try next?
     
    Last edited: Dec 16, 2021
  2. BarShiftGames

    BarShiftGames

    Joined:
    Jul 31, 2017
    Posts:
    12
    I would say it's because you put behaviors twice in your file, delete the first two lines
     
  3. IronGrimoire

    IronGrimoire

    Joined:
    Jun 11, 2016
    Posts:
    3
    Thanks for pointing that out - that was a copy past mistake I made in the post. Unfortunately, I didn't make the mistake in my YAML file, so I'm still getting the error
     
  4. jrupert-unity

    jrupert-unity

    Unity Technologies

    Joined:
    Oct 20, 2021
    Posts:
    12
  5. IronGrimoire

    IronGrimoire

    Joined:
    Jun 11, 2016
    Posts:
    3
    That was exactly what I needed! I was able to open the YAML file with notepad++ and change the encoding to UTF-8 without BOM and mlagents-lean works. @jrupert-unity Thank you so much