{"record":{"id":"607424f641e8c56e","repo":"tensorflow/models","slug":"input-path-should-be-either-1-a-str-indicating","errorCode":null,"errorMessage":"`input_path` should be either (1) a str indicating a file path/pattern, or (2) a str indicating multiple file paths/patterns separated by comma (e.g \"a, b, c\" or no spaces \"a,b,c\", or (3) a list of str, each of which is a file path/pattern or multiple file paths/patterns separated by comma, but got: %s","messagePattern":"`input_path` should be either \\(1\\) a str indicating a file path/pattern, or \\(2\\) a str indicating multiple file paths/patterns separated by comma \\(e\\.g \"a, b, c\" or no spaces \"a,b,c\", or \\(3\\) a list of str, each of which is a file path/pattern or multiple file paths/patterns separated by comma, but got: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/core/input_reader.py","lineNumber":52,"sourceCode":"  return dataset if fn is None else dataset.map(\n      fn, num_parallel_calls=tf.data.experimental.AUTOTUNE)\n\n\ndef match_files(input_path: Union[Sequence[str], str]) -> List[str]:\n  \"\"\"Matches files from an input_path.\"\"\"\n  matched_files = []\n  # Read dataset from files.\n  usage = ('`input_path` should be either (1) a str indicating a file '\n           'path/pattern, or (2) a str indicating multiple file '\n           'paths/patterns separated by comma (e.g \"a, b, c\" or no spaces '\n           '\"a,b,c\", or (3) a list of str, each of which is a file '\n           'path/pattern or multiple file paths/patterns separated by '\n           'comma, but got: %s')\n  if isinstance(input_path, str):\n    input_path_list = [input_path]\n  elif isinstance(input_path, (list, tuple)):\n    if any(not isinstance(x, str) for x in input_path):\n      raise ValueError(usage % input_path)\n    input_path_list = input_path\n  else:\n    raise ValueError(usage % input_path)\n\n  for input_path in input_path_list:\n    input_patterns = input_path.strip().split(',')\n    for input_pattern in input_patterns:\n      input_pattern = input_pattern.strip()\n      if not input_pattern:\n        continue\n      if '*' in input_pattern or '?' in input_pattern:\n        tmp_matched_files = tf.io.gfile.glob(input_pattern)\n        if not tmp_matched_files:\n          raise ValueError('%s does not match any files.' % input_pattern)\n        matched_files.extend(tmp_matched_files)\n      else:\n        matched_files.append(input_pattern)\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/core/input_reader.py#L34-L70","documentation":"Error \"`input_path` should be either (1) a str indicating a file path/pattern, or (2) a str indicating multiple file paths/patterns separated by comma (e.g \"a, b, c\" or no spaces \"a,b,c\", or (3) a list of str, each of which is a file path/pattern or multiple file paths/patterns separated by comma, but got: %s\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/core/input_reader.py:52 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"}