Search Unity

Resolved The option completion-criteria was specified in your YAML file for Lesson, but is invalid.

Discussion in 'ML-Agents' started by Yuulis04, Sep 28, 2021.

  1. Yuulis04

    Yuulis04

    Joined:
    Apr 4, 2021
    Posts:
    28
    Hello, I tried training with curriculum learning, and I wrote this yaml file. However, mlagents.trainers.exception.TrainerConfigError happened. Where did I miss? I'm using Release 17.
    yaml file:
    Code (Boo):
    1. behaviors:
    2.   School_Only1F_Hard_Cur:
    3.     trainer_type: ppo
    4.  
    5.     max_steps: 10000000
    6.     keep_checkpoints: 100
    7.     checkpoint_interval: 200000
    8.     time_horizon: 64
    9.     summary_freq: 10000
    10.     threaded: true
    11.  
    12.     hyperparameters:
    13.       batch_size: 64
    14.       buffer_size: 2048
    15.       learning_rate: 1e-4
    16.       beta: 1e-3
    17.       epsilon: 0.2
    18.       lambd: 0.95
    19.       num_epoch: 3
    20.       learning_rate_schedule: linear
    21.  
    22.     network_settings:
    23.       normalize: false
    24.       hidden_units: 512
    25.       num_layers: 3
    26.       vis_encode_type: simple
    27.  
    28.     reward_signals:
    29.       extrinsic:
    30.         gamma: 0.995
    31.         strength: 1.0
    32.  
    33.       curiosity:
    34.         gamma: 0.995
    35.         strength: 0.01
    36.         encoding_size: 64
    37.         learning_rate: 3e-4
    38.  
    39. environment_parameters:
    40.   SpawnableAreaNum:
    41.     curriculum:
    42.       - name: B_StairSide
    43.         completion-criteria:
    44.           measure: reward
    45.           behavior: School_Only1F_Hard_Cur
    46.           signal_smoothing: true
    47.           min_lesson_length: 100
    48.           threshold: 0.8
    49.         value: 0.0
    50.  
    51.       - name: A_StairSide
    52.         completion-criteria:
    53.           measure: reward
    54.           behavior: School_Only1F_Hard_Cur
    55.           signal_smoothing: true
    56.           min_lesson_length: 100
    57.           threshold: 0.7
    58.         value: 1.0
    59.  
    60.       - name: C_StairSide
    61.         completion-criteria:
    62.           measure: reward
    63.           behavior: School_Only1F_Hard_Cur
    64.           signal_smoothing: true
    65.           min_lesson_length: 100
    66.           threshold: 0.7
    67.         value: 2.0
    68.  
    69.       - name: All
    70.         value: 3.0
    71.  
    72.   StepReward:
    73.     curriculum:
    74.       - name: B_StairSide
    75.         completion-criteria:
    76.           measure: reward
    77.           behavior: School_Only1F_Hard_Cur
    78.           signal_smoothing: true
    79.           min_lesson_length: 100
    80.           threshold: 0.8
    81.         value: 0.0
    82.  
    83.       - name: A_StairSide
    84.         completion-criteria:
    85.           measure: reward
    86.           behavior: School_Only1F_Hard_Cur
    87.           signal_smoothing: true
    88.           min_lesson_length: 100
    89.           threshold: 0.7
    90.         value: 0.0
    91.  
    92.       - name: C_StairSide
    93.         completion-criteria:
    94.           measure: reward
    95.           behavior: School_Only1F_Hard_Cur
    96.           signal_smoothing: true
    97.           min_lesson_length: 100
    98.           threshold: 0.7
    99.         value: 0.0
    100.  
    101.       - name: All
    102.         value: -0.0005
    103.  
    ERRORS:

    [WARNING] 'encoding_size' was deprecated for RewardSignals. Please use network_settings.
    Traceback (most recent call last):
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\Scripts\mlagents-learn-script.py", line 33, in <module>
    sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')())
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\learn.py", line 250, in main
    run_cli(parse_command_line())
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\learn.py", line 49, in parse_command_line
    return RunOptions.from_argparse(args)
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 889, in from_argparse
    final_runoptions = RunOptions.from_dict(configured_dict)
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 906, in from_dict
    return cattr.structure(options_dict, RunOptions)
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\lib\site-packages\cattr\converters.py", line 192, in structure
    return self._structure_func.dispatch(cl)(obj, cl)
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\lib\site-packages\cattr\converters.py", line 314, in structure_attrs_fromdict
    dispatch(type_)(val, type_) if type_ is not None else val
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\lib\site-packages\cattr\converters.py", line 387, in _structure_union
    return self._structure_func.dispatch(other)(obj, other)
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 572, in structure
    environment_parameter_config, EnvironmentParameterSettings
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 53, in strict_to_cls
    d_copy[key] = check_and_structure(key, val, t)
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 44, in check_and_structure
    return cattr.structure(value, attr_fields_dict[key].type)
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\lib\site-packages\cattr\converters.py", line 192, in structure
    return self._structure_func.dispatch(cl)(obj, cl)
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\lib\site-packages\cattr\converters.py", line 327, in _structure_list
    for e in obj
    File "C:\Users\yuta04\anaconda3\envs\ML-Agents2\lib\site-packages\cattr\converters.py", line 327, in <listcomp>
    for e in obj
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 53, in strict_to_cls
    d_copy[key] = check_and_structure(key, val, t)
    File "c:\users\yuta04\ml-agents\ml-agents-release_17_branch\ml-agents\mlagents\trainers\settings.py", line 41, in check_and_structure
    f"The option {key} was specified in your YAML file for {class_type.__name__}, but is invalid."
    mlagents.trainers.exception.TrainerConfigError: The option completion-criteria was specified in your YAML file for Lesson, but is invalid.
     
  2. Yuulis04

    Yuulis04

    Joined:
    Apr 4, 2021
    Posts:
    28
    I missed writing somewhere and fixed.
    This is moving now.