{"record":{"id":"4eaba8784a22f93a","repo":"tensorflow/models","slug":"invalid-sequence-only-supports-single-level-r","errorCode":null,"errorMessage":"Invalid sequence: only supports single level {!r} of {!r} or dict or ParamsDict found: {!r}","messagePattern":"Invalid sequence: only supports single level (.+?) of (.+?) or dict or ParamsDict found: (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"official/modeling/hyperparams/base_config.py","lineNumber":148,"sourceCode":"    if not isinstance(v, cls.SEQUENCE_TYPES):\n      return False\n    return (all(isinstance(e, cls.IMMUTABLE_TYPES) for e in v) or\n            all(isinstance(e, dict) for e in v) or\n            all(isinstance(e, params_dict.ParamsDict) for e in v))\n\n  @classmethod\n  def _import_config(cls, v, subconfig_type):\n    \"\"\"Returns v with dicts converted to Configs, recursively.\"\"\"\n    if not issubclass(subconfig_type, params_dict.ParamsDict):\n      raise TypeError(\n          'Subconfig_type should be subclass of ParamsDict, found {!r}'.format(\n              subconfig_type))\n    if isinstance(v, cls.IMMUTABLE_TYPES):\n      return v\n    elif isinstance(v, cls.SEQUENCE_TYPES):\n      # Only support one layer of sequence.\n      if not cls._isvalidsequence(v):\n        raise TypeError(\n            'Invalid sequence: only supports single level {!r} of {!r} or '\n            'dict or ParamsDict found: {!r}'.format(cls.SEQUENCE_TYPES,\n                                                    cls.IMMUTABLE_TYPES, v))\n      import_fn = functools.partial(\n          cls._import_config, subconfig_type=subconfig_type)\n      return type(v)(map(import_fn, v))\n    elif isinstance(v, params_dict.ParamsDict):\n      # Deepcopy here is a temporary solution for preserving type in nested\n      # Config object.\n      return copy.deepcopy(v)\n    elif isinstance(v, dict):\n      return subconfig_type(v)\n    else:\n      raise TypeError('Unknown type: {!r}'.format(type(v)))\n\n  @classmethod\n  def _export_config(cls, v):\n    \"\"\"Returns v with Configs converted to dicts, recursively.\"\"\"","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/modeling/hyperparams/base_config.py#L130-L166","documentation":"Error \"Invalid sequence: only supports single level {!r} of {!r} or dict or ParamsDict found: {!r}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/modeling/hyperparams/base_config.py:148 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e006f5f0d534913e49c1f1dae87364039fa607e2","analyzedAt":"2026-08-24T14:09:15.576Z","schemaVersion":2},"datasetVersion":"2026-08-24T17:17:21.512Z"}