{"record":{"id":"b411f9e641cf5bd9","repo":"tensorflow/models","slug":"subconfig-type-should-be-subclass-of-paramsdict-f","errorCode":null,"errorMessage":"Subconfig_type should be subclass of ParamsDict, found {!r}","messagePattern":"Subconfig_type should be subclass of ParamsDict, found (.+?)","errorType":"exception","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"official/modeling/hyperparams/base_config.py","lineNumber":140,"sourceCode":"    Args:\n      v: Input sequence.\n\n    Returns:\n      True if the sequence is valid. Valid sequence includes the sequence\n      type in cls.SEQUENCE_TYPES and element type is in cls.IMMUTABLE_TYPES or\n      is dict or ParamsDict.\n    \"\"\"\n    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)","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/modeling/hyperparams/base_config.py#L122-L158","documentation":"Error \"Subconfig_type should be subclass of ParamsDict, found {!r}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/modeling/hyperparams/base_config.py:140 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"}