{"record":{"id":"48a4f45c20c7b715","repo":"tensorflow/models","slug":"is-not-unique-across-image-directories","errorCode":null,"errorMessage":"{} is not unique across image directories","messagePattern":"(.+?) is not unique across image directories","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"official/vision/data/create_coco_tf_record.py","lineNumber":311,"sourceCode":"    num_annotations_skipped: Number of (invalid) annotations that were ignored.\n\n  Raises:\n    ValueError: if the image pointed to by data['filename'] is not a valid JPEG,\n      does not exist, or is not unique across image directories.\n  \"\"\"\n  image_height = image['height']\n  image_width = image['width']\n  filename = image['file_name']\n  image_id = image['id']\n\n  if len(image_dirs) > 1:\n    full_paths = [os.path.join(image_dir, filename) for image_dir in image_dirs]\n    full_existing_paths = [p for p in full_paths if tf.io.gfile.exists(p)]\n    if not full_existing_paths:\n      raise ValueError(\n          '{} does not exist across image directories.'.format(filename))\n    if len(full_existing_paths) > 1:\n      raise ValueError(\n          '{} is not unique across image directories'.format(filename))\n    full_path, = full_existing_paths\n  # If there is only one image directory, it's not worth checking for existence,\n  # since trying to open the file will raise an informative error message if it\n  # does not exist.\n  else:\n    image_dir, = image_dirs\n    full_path = os.path.join(image_dir, filename)\n\n  with tf.io.gfile.GFile(full_path, 'rb') as fid:\n    encoded_jpg = fid.read()\n\n  feature_dict = tfrecord_lib.image_info_to_feature_dict(\n      image_height, image_width, filename, image_id, encoded_jpg, 'jpg')\n\n  num_annotations_skipped = 0\n  if bbox_annotations:\n    box_feature_dict, num_skipped = bbox_annotations_to_feature_dict(","sourceCodeStart":293,"sourceCodeEnd":329,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/vision/data/create_coco_tf_record.py#L293-L329","documentation":"Error \"{} is not unique across image directories\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/vision/data/create_coco_tf_record.py:311 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"}