{"record":{"id":"b7e3ff2e244c29d4","repo":"tensorflow/models","slug":"augmented-files-already-exist-in-the-following-cla","errorCode":null,"errorMessage":"Augmented files already exist in the following class folders:\n{details}\nRemove them before re-running, or run on a fresh classifier dataset.","messagePattern":"Augmented files already exist in the following class folders:\n(.+?)\nRemove them before re-running, or run on a fresh classifier dataset\\.","errorType":"exception","errorClass":"FileExistsError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/augment_train_split.py","lineNumber":408,"sourceCode":"      FileExistsError: If any class folder contains augmented files.\n  \"\"\"\n  folders_with_augmentations = []\n  for class_name, class_path in class_folders:\n    existing_augmented_files = find_pre_existing_augmentations(class_path)\n    if existing_augmented_files:\n      sample = existing_augmented_files[:5]\n      extra = len(existing_augmented_files) - len(sample)\n      sample_text = \", \".join(sample)\n      if extra > 0:\n        sample_text += f\", ... (+{extra} more)\"\n      folders_with_augmentations.append(\n          f\"  - {class_name}: {len(existing_augmented_files)} files \"\n          f\"({sample_text})\"\n      )\n\n  if folders_with_augmentations:\n    details = \"\\n\".join(folders_with_augmentations)\n    raise FileExistsError(\n        \"Augmented files already exist in the following class folders:\\n\"\n        f\"{details}\\n\"\n        \"Remove them before re-running, or run on a fresh classifier dataset.\"\n    )\n\n\n# ── Per-folder pipeline ──────────────────────────────────────────────────────\n\n\ndef process_class_folder(\n    class_name: str,\n    class_folder: str,\n    augmentations_to_apply: tuple[str, ...],\n    rotation_fill_color: tuple[int, int, int],\n) -> None:\n  \"\"\"Applies augmentations to all images in a class folder.\n\n  Args:","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/augment_train_split.py#L390-L426","documentation":"Error \"Augmented files already exist in the following class folders:\n{details}\nRemove them before re-running, or run on a fresh classifier dataset.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/augment_train_split.py:408 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"}