Skip to content

Bug: start_session() raises TypeError with multiplex predictor (SAM 3.1) #544

Description

@kuihao

Bug: start_session() raises TypeError with multiplex predictor (SAM 3.1)

Environment

  • SAM 3.1 (main branch, as of 2026-05-07)
  • build_sam3_multiplex_video_predictor

Reproduction

Run the official sam3.1_video_predictor_example.ipynb with a multiplex predictor. Cell [11] raises:

TypeError: Sam3MultiplexTrackingWithInteractivity.init_state()
    got an unexpected keyword argument 'offload_state_to_cpu'

Root Cause

start_session() in sam3_base_predictor.py unconditionally forwards all kwargs to self.model.init_state(). However, Sam3MultiplexTrackingWithInteractivity.init_state() does not accept offload_state_to_cpu.

This is inconsistent with add_prompt() and propagate_in_video() in the same file, both of which already use inspect.signature() to filter kwargs before forwarding.

Fix

PR #543 applies the same inspect-based filtering pattern to start_session(), making the base class consistent across SAM 3 and SAM 3.1 model variants.

➡️ #543

Impact

This bug makes build_sam3_multiplex_video_predictor — a SAM 3.1 feature — completely unusable out of the box via the official example notebook. The fix is a one-line pattern already established elsewhere in the same file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions