{"record":{"id":"3ba96d75cb4e2a38","repo":"tensorflow/models","slug":"the-number-of-input-path-and-weights-must-be-the-s","errorCode":null,"errorMessage":"The number of input_path and weights must be the same, but got %d input_paths and %d weights.","messagePattern":"The number of input_path and weights must be the same, but got (.+?) input_paths and (.+?) weights\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/dataloaders/input_reader.py","lineNumber":69,"sourceCode":"  if (\n      hasattr(params, 'stop_on_empty_dataset')\n      and params.stop_on_empty_dataset is not None\n  ):\n    stop_on_empty_dataset = params.stop_on_empty_dataset\n  else:\n    stop_on_empty_dataset = True\n\n  if params.weights:\n    # Combine multiple datasets using weighted sampling.\n    if (not isinstance(params.input_path, cfg.base_config.Config) or\n        not isinstance(params.weights, cfg.base_config.Config)):\n      raise ValueError(\n          'input_path and weights must both be a Config to use weighted '\n          'sampling.')\n    input_paths = params.input_path.as_dict()\n    weights = params.weights.as_dict()\n    if len(input_paths) != len(weights):\n      raise ValueError(\n          'The number of input_path and weights must be the same, but got %d '\n          'input_paths and %d weights.' % (len(input_paths), len(weights)))\n\n    for k in input_paths.keys():\n      if k not in weights:\n        raise ValueError(\n            'input_path key \\'%s\\' does not have a corresponding weight.' % k)\n\n    return build_weighted_sampling_combine_fn(weights, stop_on_empty_dataset)\n  return None\n\n\ndef calculate_batch_sizes(total_batch_size: int,\n                          pseudo_label_ratio: float,\n                          pseudo_label_batch_size: int = 0) -> Tuple[int, int]:\n  \"\"\"Calculates labeled and pseudo-labeled dataset batch sizes.\n\n  Returns (labeled_batch_size, pseudo_labeled_batch_size) given a","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/dataloaders/input_reader.py#L51-L87","documentation":"Error \"The number of input_path and weights must be the same, but got %d input_paths and %d weights.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/dataloaders/input_reader.py:69 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"}