{"record":{"id":"b5c8520b8f099f97","repo":"tensorflow/models","slug":"invalid-total-batch-size","errorCode":null,"errorMessage":"Invalid total_batch_size: {}","messagePattern":"Invalid total_batch_size: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/dataloaders/input_reader.py","lineNumber":108,"sourceCode":"  Args:\n   total_batch_size: The total batch size for all data.\n   pseudo_label_ratio: A float ratio of pseudo-labeled to labeled data in a\n     batch. If it is negative, use `pseudo_label_batch_size` instead.\n   pseudo_label_batch_size: The batch size of pseudo-labeled data. It is ignored\n     if `pseudo_label_ratio` is valid. If not, it will be used and it cannot be\n     larger than total global batch size or less than 0 if pseudo_label_ratio is\n     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","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/dataloaders/input_reader.py#L90-L126","documentation":"Error \"Invalid total_batch_size: {}\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/dataloaders/input_reader.py:108 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"}