{"record":{"id":"2750ccbf9ab482db","repo":"tensorflow/models","slug":"a-combine-fn-is-required-if-input-path-or-tfds","errorCode":null,"errorMessage":"A combine_fn is required if `input_path` or `tfds_name` is a dict.","messagePattern":"A combine_fn is required if `input_path` or `tfds_name` is a dict\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/core/input_reader.py","lineNumber":274,"sourceCode":"        It will be executed after parser_fn.\n      transform_and_batch_fn: An optional `callable` that takes a\n        `tf.data.Dataset` object and an optional `tf.distribute.InputContext` as\n        input, and returns a `tf.data.Dataset` object. It will be executed after\n        `parser_fn` to transform and batch the dataset; if None, after\n        `parser_fn` is executed, the dataset will be batched into per-replica\n        batch size.\n      postprocess_fn: A optional `callable` that processes batched tensors. It\n        will be executed after batching.\n    \"\"\"\n    if params.input_path and params.tfds_name:\n      raise ValueError('At most one of `input_path` and `tfds_name` can be '\n                       'specified, but got %s and %s.' %\n                       (params.input_path, params.tfds_name))\n\n    if (isinstance(params.input_path, cfg.base_config.Config) or\n        isinstance(params.tfds_name, cfg.base_config.Config)\n        ) and combine_fn is None:\n      raise ValueError(\n          'A combine_fn is required if `input_path` or `tfds_name` is a dict.')\n\n    self._tfds_name = params.tfds_name\n    self._tfds_data_dir = params.tfds_data_dir\n    self._matched_files = None\n    if not params.input_path:\n      # Read dataset from TFDS.\n      if not params.tfds_split:\n        raise ValueError(\n            '`tfds_name` is %s, but `tfds_split` is not specified.' %\n            params.tfds_name)\n    else:\n      self._matched_files = self.get_files(params.input_path)\n\n    self._global_batch_size = params.global_batch_size\n    self._is_training = params.is_training\n    self._drop_remainder = params.drop_remainder\n    self._shuffle_buffer_size = params.shuffle_buffer_size","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/core/input_reader.py#L256-L292","documentation":"Error \"A combine_fn is required if `input_path` or `tfds_name` is a dict.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/core/input_reader.py:274 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"}