{"record":{"id":"3414afa2ccea6794","repo":"tensorflow/models","slug":"the-batch-size-of-pseudo-label-dataset-should-not","errorCode":null,"errorMessage":"The batch size of pseudo-label dataset should not be larger than total global batch size.","messagePattern":"The batch size of pseudo-label dataset should not be larger than total global batch size\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/dataloaders/input_reader.py","lineNumber":115,"sourceCode":"     also less than 0.\n\n  Returns:\n    (labeled_batch_size, pseudo_labeled_batch_size) as ints.\n\n  Raises:\n    ValueError: If total_batch_size is negative, or both If pseudo_label_ratio\n      is negative and pseudo-label global_batch_size is negative or larger than\n      total batch size.\n  \"\"\"\n  if total_batch_size < 0:\n    raise ValueError('Invalid total_batch_size: {}'.format(total_batch_size))\n  if pseudo_label_ratio >= 0.0:\n    ratio_factor = pseudo_label_ratio / (1.0 + pseudo_label_ratio)\n    pseudo_label_batch_size = int(total_batch_size * ratio_factor)\n    label_batch_size = total_batch_size - pseudo_label_batch_size\n  else:\n    if pseudo_label_batch_size > total_batch_size or pseudo_label_batch_size < 0:\n      raise ValueError(\n          'The batch size of pseudo-label dataset should not be larger than '\n          'total global batch size.')\n    logging.info('data_ratio for pseudo-label dataset is less than 0. '\n                 'Use global_batch_size from pseudo_label data config instead.')\n    label_batch_size = total_batch_size - pseudo_label_batch_size\n  return label_batch_size, pseudo_label_batch_size\n\n\nclass CombinationDatasetInputReader(input_reader.InputReader):\n  \"\"\"Combination dataset input reader.\"\"\"\n\n  def __init__(self,\n               params: cfg.DataConfig,\n               dataset_fn=tf.data.TFRecordDataset,\n               pseudo_label_dataset_fn=tf.data.TFRecordDataset,\n               decoder_fn: Optional[Callable[..., Any]] = None,\n               combine_fn: Optional[Callable[..., Any]] = None,\n               sample_fn: Optional[Callable[..., Any]] = None,","sourceCodeStart":97,"sourceCodeEnd":133,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/dataloaders/input_reader.py#L97-L133","documentation":"Error \"The batch size of pseudo-label dataset should not be larger than total global batch size.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/dataloaders/input_reader.py:115 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"}