invoke-ai/InvokeAI · info · NotAMatchError

state dict does not look like GGUF quantized

Error message

state dict does not look like GGUF quantized

What it means

NotAMatchError from raise_if_doesnt_look_like_gguf_quantized. After confirming T5 block keys, the GGUF config verifies the loaded state dict actually contains GGMLTensor values (the ComfyUI-style quantized tensor wrapper). A T5-shaped state dict with no GGMLTensors is not gguf-quantized, so the config declines.

Source

Thrown at invokeai/backend/model_manager/configs/t5_encoder.py:233

        cls.raise_if_doesnt_look_like_gguf_quantized(mod)

        return cls(**override_fields)

    @classmethod
    def raise_if_doesnt_look_like_t5_encoder(cls, mod: ModelOnDisk) -> None:
        # llama.cpp T5 encoders use the ``enc.`` prefix on their transformer blocks and final norm. This
        # distinguishes them from decoder-only GGUF models (e.g. Qwen3, which uses bare ``blk.*``).
        state_dict = mod.load_state_dict()
        if not state_dict_has_any_keys_starting_with(
            state_dict, "enc.blk."
        ) and not state_dict_has_any_keys_ending_with(state_dict, "enc.output_norm.weight"):
            raise NotAMatchError("state dict does not look like a T5 encoder (no 'enc.blk.*' keys)")

    @classmethod
    def raise_if_doesnt_look_like_gguf_quantized(cls, mod: ModelOnDisk) -> None:
        has_ggml = any(isinstance(v, GGMLTensor) for v in mod.load_state_dict().values())
        if not has_ggml:
            raise NotAMatchError("state dict does not look like GGUF quantized")

View on GitHub (pinned to 0b6a024f2f)

Solutions

  1. Ensure the file is a genuine gguf conversion (convert with city96's tooling) and rescanned
  2. Install/repair the gguf quantization support libraries so tensors load as GGMLTensor
  3. Register the (unquantized) T5 under a non-gguf config explicitly

Example fix

// before
cp t5-encoder.safetensors t5-encoder.gguf   # not a real conversion
// after
python convert_sd_to_gguf.py t5-encoder.safetensors --out t5-encoder-Q8_0.gguf
Defensive patterns

Strategy: validation

Validate before calling

def is_real_gguf(gguf_path) -> bool:
    from invokeai.backend.quantization.gguf import load_gguf_state_dict
    from invokeai.backend.quantization.gguf import GGMLTensor
    return any(isinstance(v, GGMLTensor) for v in load_gguf_state_dict(gguf_path).values())

Try / catch

try:
    install_model(path)
except NotAMatchError as e:
    if "GGUF quantized" in str(e):
        logger.error("File is not genuine gguf (renamed safetensors?); convert or reinstall")

Prevention

When it happens

Trigger: from_model_on_disk on a model whose load_state_dict() values contain no GGMLTensor instances — e.g. a .safetensors T5 probed against the gguf config, or a gguf file loaded without the gguf loader producing GGMLTensor objects.

Common situations: Giving the file a .gguf extension without actually converting, scanning fp16 safetensors T5 against the gguf config, or missing/incompatible gguf-quant libraries so tensors dequantize to plain tensors.

Related errors


AI-assisted analysis of invoke-ai/InvokeAI@0b6a024f2f (2026-08-29). Data as JSON: /api/errors/258df13c59505643. Report an issue: GitHub.