{"record":{"id":"c51d133ef6827d2e","repo":"Unity-Technologies/ml-agents","slug":"unsupported-parameter-environment-parameter-settin","errorCode":null,"errorMessage":"Unsupported parameter environment parameter settings {d}.","messagePattern":"Unsupported parameter environment parameter settings (.+?)\\.","errorType":"validation","errorClass":"TrainerConfigError","httpStatus":null,"severity":"error","filePath":"ml-agents/mlagents/trainers/settings.py","lineNumber":566,"sourceCode":"                raise TrainerConfigError(\n                    f\"A non-terminal lesson does not have a completion_criteria for {parameter_name}.\"\n                )\n            if index == num_lessons - 1 and lesson.completion_criteria is not None:\n                warnings.warn(\n                    f\"Your final lesson definition contains completion_criteria for {parameter_name}.\"\n                    f\"It will be ignored.\",\n                    TrainerConfigWarning,\n                )\n\n    @staticmethod\n    def structure(d: Mapping, t: type) -> Dict[str, \"EnvironmentParameterSettings\"]:\n        \"\"\"\n        Helper method to structure a Dict of EnvironmentParameterSettings class. Meant\n        to be registered with cattr.register_structure_hook() and called with\n        cattr.structure().\n        \"\"\"\n        if not isinstance(d, Mapping):\n            raise TrainerConfigError(\n                f\"Unsupported parameter environment parameter settings {d}.\"\n            )\n        d_final: Dict[str, EnvironmentParameterSettings] = {}\n        for environment_parameter, environment_parameter_config in d.items():\n            if (\n                isinstance(environment_parameter_config, Mapping)\n                and \"curriculum\" in environment_parameter_config\n            ):\n                d_final[environment_parameter] = strict_to_cls(\n                    environment_parameter_config, EnvironmentParameterSettings\n                )\n                EnvironmentParameterSettings._check_lesson_chain(\n                    d_final[environment_parameter].curriculum, environment_parameter\n                )\n            else:\n                sampler = ParameterRandomizationSettings.structure(\n                    environment_parameter_config, ParameterRandomizationSettings\n                )","sourceCodeStart":548,"sourceCodeEnd":584,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/ml-agents/mlagents/trainers/settings.py#L548-L584","documentation":"The cattr structuring hook for environment parameters requires the input to be a Mapping (dict). If the raw value for environment parameters is any other type, mlagents wraps it in TrainerConfigError indicating the settings are unsupported.","triggerScenarios":"Passing a non-dict (list, string, None) where the 'environment_parameters' section expects a dict of {parameter_name: config}, e.g. via YAML that parsed a scalar, or calling cattr.structure manually with a non-Mapping object.","commonSituations":"YAML configs where indentation makes the parameter block a string or list; programmatically building EnvironmentParameterSettings from JSON that isn't a dict; typos turning the section into a scalar.","solutions":["Ensure the environment_parameters value is a mapping: {param_name: {curriculum: ...} or a scalar}.","Check YAML indentation so the block nests correctly under environment_parameters.","Log/print the parsed dict before structuring to confirm its type."],"exampleFix":"# before\nenvironment_parameters:\n  - goal_size\n# after\nenvironment_parameters:\n  goal_size:\n    curriculum:\n      - value: 1.0","handlingStrategy":"type-guard","validationCode":"if not isinstance(cfg.get('environment_parameters'), dict):\n    raise ValueError('environment_parameters must be a mapping of parameter name -> settings')","typeGuard":"def is_param_settings(x):\n    return isinstance(x, dict) and all(isinstance(k, str) for k in x.keys())","tryCatchPattern":"from mlagents.trainers.exception import TrainerConfigError\ntry:\n    structure_env_params(d)\nexcept TrainerConfigError as e:\n    logger.error('Bad environment_parameters section: %s', e)","preventionTips":["Keep environment_parameters as a YAML mapping, never a list or scalar","Check indentation in YAML editors with schema validation","Structure configs through cattr early in tests to catch format issues"],"tags":["config","deserialization","ml-agents"],"backgroundTag":"schema-validation-failed","analyzedSha":"3ecb446f75d1e7400eb404c562dc005d3164cffc","analyzedAt":"2026-09-02T16:33:12.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}