{"record":{"id":"0d6372568db82e3a","repo":"tensorflow/models","slug":"the-sam3-package-is-not-installed-or-available-i-0d6372","errorCode":null,"errorMessage":"The 'sam3' package is not installed or available in python path. Cannot build the SAM3 processor.","messagePattern":"The 'sam3' package is not installed or available in python path\\. Cannot build the SAM3 processor\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/segmentation.py","lineNumber":127,"sourceCode":"def build_sam3_processor(\n    detection_config: config_loader.DetectionConfig,\n    sam3_checkpoint_path: str,\n) -> tuple[Any, Any]:\n  \"\"\"Builds the SAM3 model and its processor.\n\n  Args:\n      detection_config: Validated detection thresholds for the active prompt.\n      sam3_checkpoint_path: Absolute path to the SAM3 checkpoint.\n\n  Returns:\n      A tuple of ``(sam3_model, sam3_processor)``.\n\n  Raises:\n      ImportError: If the ``sam3`` package is not installed or available on\n          the Python path.\n  \"\"\"\n  if sam3_model_builder is None or sam3_image_processor is None:\n    raise ImportError(\n        \"The 'sam3' package is not installed or available in python path. \"\n        \"Cannot build the SAM3 processor.\"\n    )\n  sam3_model = sam3_model_builder.build_sam3_image_model(\n      checkpoint_path=sam3_checkpoint_path\n  )\n  sam3_model.to(device=DEVICE)\n  sam3_processor = sam3_image_processor.Sam3Processor(\n      sam3_model,\n      confidence_threshold=detection_config.confidence_threshold,\n  )\n  return sam3_model, sam3_processor\n\n\n# ── Dataset discovery and validation ──────────────────────────────────────────\n\n\ndef discover_dataset_directories(root_dir: str) -> list[tuple[str, str]]:","sourceCodeStart":109,"sourceCodeEnd":145,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/segmentation.py#L109-L145","documentation":"Error \"The 'sam3' package is not installed or available in python path. Cannot build the SAM3 processor.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/data_generation/auto_labeler_pipeline/segmentation.py:127 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"}