roboflow/supervision · error · ValueError

Invalid LMM string '{lmm}'. Must be one of {[m.value for m i

Error message

Invalid LMM string '{lmm}'. Must be one of {[m.value for m in LMM]}

What it means

Error "Invalid LMM string '{lmm}'. Must be one of {[m.value for m in LMM]}" thrown in roboflow/supervision.

Source

Thrown at src/supervision/detection/core.py:1597

            ```
        """  # noqa: E501

        warn_deprecated(
            "`Detections.from_lmm` is deprecated since `supervision-0.26.0` "
            "and will be removed in `supervision-0.31.0`. "
            "Use `Detections.from_vlm` instead."
        )

        # LMM and VLM are mirror enums (identical string values) so value-based
        # lookup is exhaustive by construction — no hand-maintained mapping needed.
        if isinstance(lmm, LMM):
            vlm = VLM(lmm.value)

        elif isinstance(lmm, str):
            try:
                lmm_enum = LMM(lmm.lower())
            except ValueError:
                raise ValueError(
                    f"Invalid LMM string '{lmm}'. Must be one of "
                    f"{[m.value for m in LMM]}"
                )
            vlm = VLM(lmm_enum.value)

        else:
            raise ValueError(
                f"Invalid type for 'lmm': {type(lmm)}. Must be LMM or str."
            )

        return cls.from_vlm(vlm=vlm, result=result, **kwargs)

    @classmethod
    def from_vlm(
        cls, vlm: VLM | str, result: str | dict[str, Any], **kwargs: Any
    ) -> Detections:
        """

View on GitHub (pinned to 7f254d9784)

Solutions

  1. Pass one of the valid LMM enum values as a string, e.g. 'paligemma' or another value listed in the error message.
  2. Alternatively pass the LMM enum member directly instead of a string.

When it happens

Trigger: Thrown at src/supervision/detection/core.py:1597 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of roboflow/supervision@7f254d9784 (2026-08-15). Data as JSON: /api/errors/2443a03556b10eb4. Report an issue: GitHub.