{"record":{"id":"a4c65c3a3ffd74aa","repo":"tensorflow/models","slug":"path-not-exist-while-traversing-the-dictionary-d","errorCode":null,"errorMessage":"Path not exist while traversing the dictionary: d with keys: %s.","messagePattern":"Path not exist while traversing the dictionary: d with keys: (.+?)\\.","errorType":"exception","errorClass":"KeyError","httpStatus":null,"severity":"error","filePath":"official/core/train_utils.py","lineNumber":60,"sourceCode":"\n\ndef get_leaf_nested_dict(d: Dict[str, Any], keys: List[str]) -> Dict[str, Any]:\n  \"\"\"Get leaf from a dictionary with arbitrary depth with a list of keys.\n\n  Args:\n    d: The dictionary to extract value from.\n    keys: The list of keys to extract values recursively.\n\n  Returns:\n    The value of the leaf.\n\n  Raises:\n    KeyError: If the value of keys extracted is a dictionary.\n  \"\"\"\n  leaf = d\n  for k in keys:\n    if not isinstance(leaf, dict) or k not in leaf:\n      raise KeyError(\n          'Path not exist while traversing the dictionary: d with keys'\n          ': %s.' % keys)\n    leaf = leaf[k]\n\n  if isinstance(leaf, dict):\n    raise KeyError('The value extracted with keys: %s is not a leaf of the '\n                   'dictionary: %s.' % (keys, d))\n  return leaf\n\n\ndef cast_leaf_nested_dict(d: Dict[str, Any],\n                          cast_fn: Callable[[Any], Any]) -> Dict[str, Any]:\n  \"\"\"Cast the leaves of a dictionary with arbitrary depth in place.\n\n  Args:\n    d: The dictionary to extract value from.\n    cast_fn: The casting function.\n","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/core/train_utils.py#L42-L78","documentation":"Error \"Path not exist while traversing the dictionary: d with keys: %s.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/core/train_utils.py:60 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"}