{"record":{"id":"8327749901c2874b","repo":"tensorflow/models","slug":"must-use-drop-remainder-true-with-combinationdatas","errorCode":null,"errorMessage":"Must use drop_remainder=True with CombinationDatasetInputReader","messagePattern":"Must use drop_remainder=True with CombinationDatasetInputReader","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/dataloaders/input_reader.py","lineNumber":193,"sourceCode":"    \"\"\"\n    super().__init__(\n        params=params,\n        dataset_fn=dataset_fn,\n        decoder_fn=decoder_fn,\n        combine_fn=combine_fn,\n        sample_fn=sample_fn,\n        parser_fn=parser_fn,\n        transform_and_batch_fn=transform_and_batch_fn,\n        postprocess_fn=postprocess_fn)\n\n    self._pseudo_label_file_pattern = params.pseudo_label_data.input_path\n    self._pseudo_label_dataset_fn = pseudo_label_dataset_fn\n    self._pseudo_label_data_ratio = params.pseudo_label_data.data_ratio\n    self._pseudo_label_batch_size = params.pseudo_label_data.global_batch_size\n    self._pseudo_label_matched_files = input_reader.match_files(\n        self._pseudo_label_file_pattern)\n    if not self._drop_remainder:\n      raise ValueError(\n          'Must use drop_remainder=True with CombinationDatasetInputReader')\n\n  def read(\n      self,\n      input_context: Optional[tf.distribute.InputContext] = None\n  ) -> tf.data.Dataset:\n    \"\"\"Generates a tf.data.Dataset object.\"\"\"\n\n    labeled_batch_size, pl_batch_size = calculate_batch_sizes(\n        self._global_batch_size, self._pseudo_label_data_ratio,\n        self._pseudo_label_batch_size)\n\n    if not labeled_batch_size and pl_batch_size:\n      raise ValueError(\n          'Invalid batch_size: {} and pseudo_label_data_ratio: {}, '\n          'resulting in a 0 batch size for one of the datasets.'.format(\n              self._global_batch_size, self._pseudo_label_data_ratio))\n","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/dataloaders/input_reader.py#L175-L211","documentation":"Error \"Must use drop_remainder=True with CombinationDatasetInputReader\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/dataloaders/input_reader.py:193 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"}