{"record":{"id":"62aff2a6d08e0074","repo":"tensorflow/models","slug":"unsupported-relation-in-restriction","errorCode":null,"errorMessage":"Unsupported relation in restriction.","messagePattern":"Unsupported relation in restriction\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/modeling/hyperparams/params_dict.py","lineNumber":333,"sourceCode":"          raise KeyError(\n              'Found inconsistency between key `{}` and key `{}`.'.format(\n                  tokens[0], tokens[1]))\n      elif '>=' in restriction:\n        tokens = restriction.split('>=')\n        _, left_v, _, right_v = _get_kvs(tokens, params_dict)\n        if left_v < right_v:\n          raise KeyError(\n              'Found inconsistency between key `{}` and key `{}`.'.format(\n                  tokens[0], tokens[1]))\n      elif '>' in restriction:\n        tokens = restriction.split('>')\n        _, left_v, _, right_v = _get_kvs(tokens, params_dict)\n        if left_v <= right_v:\n          raise KeyError(\n              'Found inconsistency between key `{}` and key `{}`.'.format(\n                  tokens[0], tokens[1]))\n      else:\n        raise ValueError('Unsupported relation in restriction.')\n\n\ndef read_yaml_to_params_dict(file_path: str):\n  \"\"\"Reads a YAML file to a ParamsDict.\"\"\"\n  with tf.io.gfile.GFile(file_path, 'r') as f:\n    params_dict = yaml.load(f, Loader=_LOADER)\n    return ParamsDict(params_dict)\n\n\ndef save_params_dict_to_yaml(params, file_path):\n  \"\"\"Saves the input ParamsDict to a YAML file.\"\"\"\n  with tf.io.gfile.GFile(file_path, 'w') as f:\n\n    def _my_list_rep(dumper, data):\n      # u'tag:yaml.org,2002:seq' is the YAML internal tag for sequence.\n      return dumper.represent_sequence(\n          u'tag:yaml.org,2002:seq', data, flow_style=True)\n","sourceCodeStart":315,"sourceCodeEnd":351,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/modeling/hyperparams/params_dict.py#L315-L351","documentation":"Error \"Unsupported relation in restriction.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/modeling/hyperparams/params_dict.py:333 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"}