{"record":{"id":"47868ef681c88cfb","repo":"tensorflow/models","slug":"matched-files-should-be-a-list-or-dict","errorCode":null,"errorMessage":"`matched_files` should be a list or dict.","messagePattern":"`matched_files` should be a list or dict\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/core/input_reader.py","lineNumber":457,"sourceCode":"            tfds_name=self._tfds_name,\n            tfds_data_dir=self._tfds_data_dir,\n            tfds_split=self._tfds_split,\n            tfds_skip_decoding_feature=self._tfds_skip_decoding_feature,\n            tfds_as_supervised=self._tfds_as_supervised,\n            input_context=input_context,\n            seed=self._seed,\n            is_training=self._is_training,\n            cache=self._cache,\n            cycle_length=self._cycle_length,\n            block_length=self._block_length)\n    elif isinstance(matched_files, (list, tuple)):\n      dataset = _files_to_dataset(matched_files)\n    elif isinstance(matched_files, dict):\n      dataset = {}\n      for k, fs in matched_files.items():\n        dataset[k] = _files_to_dataset(fs)\n    else:\n      raise ValueError('`matched_files` should be a list or dict.')\n\n    return dataset\n\n  def _decode_and_parse_dataset(\n      self,\n      dataset: Union[tf.data.Dataset, Dict[Text, tf.data.Dataset]],\n      batch_size: int,\n      input_context: Optional[tf.distribute.InputContext] = None\n  ) -> tf.data.Dataset:\n    \"\"\"Returns a tf.data.Dataset object after shuffling, decoding, and parsing.\"\"\"\n\n    def _shuffle_and_decode(ds):\n      # If cache is enabled, we will call `shuffle()` later after `cache()`.\n      if self._is_training and not self._cache:\n        ds = ds.shuffle(self._shuffle_buffer_size, seed=self._seed)\n      # Decode\n      ds = _maybe_map_fn(ds, self._decoder_fn)\n      return ds","sourceCodeStart":439,"sourceCodeEnd":475,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/core/input_reader.py#L439-L475","documentation":"Error \"`matched_files` should be a list or dict.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/core/input_reader.py:457 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"}