{"record":{"id":"e59542a5ee05071c","repo":"tensorflow/models","slug":"the-sam3-package-is-not-installed-or-available-i-e59542","errorCode":null,"errorMessage":"The 'sam3' package is not installed or available in python path. Cannot construct SAM3Detector from checkpoint.","messagePattern":"The 'sam3' package is not installed or available in python path\\. Cannot construct SAM3Detector from checkpoint\\.","errorType":"exception","errorClass":"ImportError","httpStatus":null,"severity":"error","filePath":"official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/sam3_detector.py","lineNumber":103,"sourceCode":"      device: str,\n      prompt_config: config_loader.PromptConfig,\n  ) -> Self:\n    \"\"\"Constructs a SAM3Detector by loading a model from a checkpoint.\n\n    Args:\n      checkpoint_path: Path to the SAM3 model checkpoint.\n      device: Requested device string (e.g., 'cuda', 'cpu', 'mps').\n      prompt_config: Detection and post-processing thresholds for the active\n        prompt.\n\n    Returns:\n      An initialized `SAM3Detector` instance on the resolved device.\n\n    Raises:\n      ImportError: If the 'sam3' package is not installed or available.\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 construct SAM3Detector from checkpoint.\"\n      )\n\n    resolved_device = _resolve_device(device)\n    model = sam3_model_builder.build_sam3_image_model(\n        checkpoint_path=str(checkpoint_path)\n    )\n    model.to(device=resolved_device)\n    processor = sam3_image_processor.Sam3Processor(\n        model,\n        confidence_threshold=prompt_config.confidence_threshold,\n    )\n    return cls(\n        model=model,\n        processor=processor,\n        device=resolved_device,\n        prompt_config=prompt_config,","sourceCodeStart":85,"sourceCodeEnd":121,"githubUrl":"https://github.com/tensorflow/models/blob/e006f5f0d534913e49c1f1dae87364039fa607e2/official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/sam3_detector.py#L85-L121","documentation":"Error \"The 'sam3' package is not installed or available in python path. Cannot construct SAM3Detector from checkpoint.\" thrown in tensorflow/models.","triggerScenarios":"Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/sam3_detector.py:103 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"}