tensorflow/models · error · ImportError

The 'sam3' package is not installed or available in python p

Error message

The 'sam3' package is not installed or available in python path. Cannot construct SAM3Detector from checkpoint.

What it means

Error "The 'sam3' package is not installed or available in python path. Cannot construct SAM3Detector from checkpoint." thrown in tensorflow/models.

Source

Thrown at official/projects/waste_identification_ml/model_inference_with_tracking/sam3_dinov3_tracking_pipeline/sam3_detector.py:103

      device: str,
      prompt_config: config_loader.PromptConfig,
  ) -> Self:
    """Constructs a SAM3Detector by loading a model from a checkpoint.

    Args:
      checkpoint_path: Path to the SAM3 model checkpoint.
      device: Requested device string (e.g., 'cuda', 'cpu', 'mps').
      prompt_config: Detection and post-processing thresholds for the active
        prompt.

    Returns:
      An initialized `SAM3Detector` instance on the resolved device.

    Raises:
      ImportError: If the 'sam3' package is not installed or available.
    """
    if sam3_model_builder is None or sam3_image_processor is None:
      raise ImportError(
          "The 'sam3' package is not installed or available in python path. "
          "Cannot construct SAM3Detector from checkpoint."
      )

    resolved_device = _resolve_device(device)
    model = sam3_model_builder.build_sam3_image_model(
        checkpoint_path=str(checkpoint_path)
    )
    model.to(device=resolved_device)
    processor = sam3_image_processor.Sam3Processor(
        model,
        confidence_threshold=prompt_config.confidence_threshold,
    )
    return cls(
        model=model,
        processor=processor,
        device=resolved_device,
        prompt_config=prompt_config,

View on GitHub (pinned to e006f5f0d5)

When it happens

Trigger: 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.

Common situations: See trigger scenarios.


AI-assisted analysis of tensorflow/models@e006f5f0d5 (2026-08-24). Data as JSON: /api/errors/e59542a5ee05071c. Report an issue: GitHub.