{"record":{"id":"a7bb4fe70f59d8d3","repo":"Unity-Technologies/ml-agents","slug":"the-option-was-specified-in-your-yaml-file-but","errorCode":null,"errorMessage":"The option {} was specified in your YAML file, but is invalid.","messagePattern":"The option (.+?) was specified in your YAML file, but is invalid\\.","errorType":"validation","errorClass":"TrainerConfigError","httpStatus":null,"severity":"error","filePath":"ml-agents/mlagents/trainers/settings.py","lineNumber":923,"sourceCode":"        # Load YAML\n        configured_dict: Dict[str, Any] = {\n            \"checkpoint_settings\": {},\n            \"env_settings\": {},\n            \"engine_settings\": {},\n            \"torch_settings\": {},\n        }\n        _require_all_behaviors = True\n        if config_path is not None:\n            configured_dict.update(load_config(config_path))\n        else:\n            # If we're not loading from a file, we don't require all behavior names to be specified.\n            _require_all_behaviors = False\n\n        # Use the YAML file values for all values not specified in the CLI.\n        for key in configured_dict.keys():\n            # Detect bad config options\n            if key not in attr.fields_dict(RunOptions):\n                raise TrainerConfigError(\n                    \"The option {} was specified in your YAML file, but is invalid.\".format(\n                        key\n                    )\n                )\n\n        # Override with CLI args\n        # Keep deprecated --load working, TODO: remove\n        argparse_args[\"resume\"] = argparse_args[\"resume\"] or argparse_args[\"load_model\"]\n\n        for key, val in argparse_args.items():\n            if key in DetectDefault.non_default_args:\n                if key in attr.fields_dict(CheckpointSettings):\n                    configured_dict[\"checkpoint_settings\"][key] = val\n                elif key in attr.fields_dict(EnvironmentSettings):\n                    configured_dict[\"env_settings\"][key] = val\n                elif key in attr.fields_dict(EngineSettings):\n                    configured_dict[\"engine_settings\"][key] = val\n                elif key in attr.fields_dict(TorchSettings):","sourceCodeStart":905,"sourceCodeEnd":941,"githubUrl":"https://github.com/Unity-Technologies/ml-agents/blob/3ecb446f75d1e7400eb404c562dc005d3164cffc/ml-agents/mlagents/trainers/settings.py#L905-L941","documentation":"Raised in TrainerSettings.from_argparse (run trainer settings parsing) when a key loaded from the user's YAML config file does not correspond to any recognized setting in the argparse-based settings structure. It is a generic config-key guard: the option name itself is at fault — usually a typo, an option from an incompatible ml-agents version, or an option placed in the wrong section of the YAML file.","triggerScenarios":"Thrown at ml-agents/mlagents/trainers/settings.py:923 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the highlighted option name for typos against the official ml-agents configuration documentation for your version","Remove or rename options that were renamed or removed in the ml-agents version you are running","Verify the option is placed under the correct top-level section (e.g. checkpoint_settings, env_settings, engine_settings) rather than an arbitrary location"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3ecb446f75d1e7400eb404c562dc005d3164cffc","analyzedAt":"2026-09-02T16:33:12.832Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T21:17:11.164Z"}