{"record":{"id":"c6532d554e8dca2b","repo":"tensorflow/models","slug":"json-files-for-shots-seed-have-different-i","errorCode":null,"errorMessage":"JSON files for {} shots (seed {}) have different info, licences, or categories fields","messagePattern":"JSON files for (.+?) shots \\(seed (.+?)\\) have different info, licences, or categories fields","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"official/vision/data/process_coco_few_shot_json_files.py","lineNumber":117,"sourceCode":"        workdir, 'datasplit', '{}_base.json'.format(name))\n    with tf.io.gfile.GFile(output_path, 'w') as f:\n      json.dump(json_dict, f)\n\n  for seed, shots in itertools.product(SEEDS, SHOTS):\n    # Retrieve all examples for a given seed and shots setting.\n    file_paths = [os.path.join(workdir, suffix)\n                  for suffix in FILE_SUFFIXES[(seed, shots)]]\n    json_dicts = []\n    for file_path in file_paths:\n      with tf.io.gfile.GFile(file_path, 'r') as f:\n        json_dicts.append(json.load(f))\n\n    # Make sure that all JSON files for a given seed and shots setting have the\n    # same metadata. We count on this to fuse them later on.\n    metadata_dicts = [{'info': d['info'], 'licenses': d['licenses'],\n                       'categories': d['categories']} for d in json_dicts]\n    if not all(d == metadata_dicts[0] for d in metadata_dicts[1:]):\n      raise RuntimeError(\n          'JSON files for {} shots (seed {}) '.format(shots, seed) +\n          'have different info, licences, or categories fields')\n\n    # Retrieve images across all JSON files.\n    images = sum((d['images'] for d in json_dicts), [])\n    # Remove duplicate image entries.\n    images = list({image['id']: image for image in images}.values())\n\n    output_dict = {\n        'info': json_dicts[0]['info'],\n        'licenses': json_dicts[0]['licenses'],\n        'categories': json_dicts[0]['categories'],\n        'images': images,\n        'annotations': sum((d['annotations'] for d in json_dicts), [])\n    }\n\n    output_path = os.path.join(workdir,\n                               '{}shot_seed{}.json'.format(shots, seed))","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/data/process_coco_few_shot_json_files.py#L99-L135","documentation":"Error \"JSON files for {} shots (seed {}) have different info, licences, or categories fields\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/data/process_coco_few_shot_json_files.py:117 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"}