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.
Bug:
start_session()raisesTypeErrorwith multiplex predictor (SAM 3.1)Environment
build_sam3_multiplex_video_predictorReproduction
Run the official
sam3.1_video_predictor_example.ipynbwith a multiplex predictor. Cell [11] raises:Root Cause
start_session()insam3_base_predictor.pyunconditionally forwards all kwargs toself.model.init_state(). However,Sam3MultiplexTrackingWithInteractivity.init_state()does not acceptoffload_state_to_cpu.This is inconsistent with
add_prompt()andpropagate_in_video()in the same file, both of which already useinspect.signature()to filter kwargs before forwarding.Fix
PR #543 applies the same
inspect-based filtering pattern tostart_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.