opendatalab/MinerU · error · NotImplementedError

mode[{model_name}_model] is not implemented!

Error message

mode[{model_name}_model] is not implemented!

What it means

Same guard as the detection variant, but in the recognition MobileNetV3 backbone: only 'small' and 'large' model names have layer tables, so any other model_name raises NotImplementedError when the network is built.

Source

Thrown at mineru/model/utils/pytorchocr/modeling/backbones/rec_mobilenet_v3.py:73

            cls_ch_squeeze = 960
        elif model_name == "small":
            cfg = [
                # k, exp, c,  se,     nl,  s,
                [3, 16, 16, True, "relu", (small_stride[0], 1)],
                [3, 72, 24, False, "relu", (small_stride[1], 1)],
                [3, 88, 24, False, "relu", 1],
                [5, 96, 40, True, "hard_swish", (small_stride[2], 1)],
                [5, 240, 40, True, "hard_swish", 1],
                [5, 240, 40, True, "hard_swish", 1],
                [5, 120, 48, True, "hard_swish", 1],
                [5, 144, 48, True, "hard_swish", 1],
                [5, 288, 96, True, "hard_swish", (small_stride[3], 1)],
                [5, 576, 96, True, "hard_swish", 1],
                [5, 576, 96, True, "hard_swish", 1],
            ]
            cls_ch_squeeze = 576
        else:
            raise NotImplementedError(
                "mode[" + model_name + "_model] is not implemented!"
            )

        supported_scale = [0.35, 0.5, 0.75, 1.0, 1.25]
        assert (
            scale in supported_scale
        ), "supported scales are {} but input scale is {}".format(
            supported_scale, scale
        )

        inplanes = 16
        # conv1
        self.conv1 = ConvBNLayer(
            in_channels=in_channels,
            out_channels=make_divisible(inplanes * scale),
            kernel_size=3,
            stride=2,
            padding=1,

View on GitHub (pinned to 4fe4bde114)

Solutions

  1. Set model_name to 'small' or 'large' in the recognition backbone config.
  2. For other capacities use scale in [0.35, 0.5, 0.75, 1.0, 1.25] with a supported model_name.

Example fix

# before
Backbone:
  name: MobileNetV3
  model_name: tiny

# after
Backbone:
  name: MobileNetV3
  model_name: small
  scale: 0.5
Defensive patterns

Strategy: validation

Validate before calling

model_name = backbone_cfg.get("model_name")
assert model_name in {"large", "small"}, f"MobileNetV3 rec supports large/small, got {model_name!r}"

Prevention

When it happens

Trigger: RecModel constructed with Backbone.name=MobileNetV3 and model_name other than 'small'/'large' (e.g. 'medium', 'tiny'), passed via YAML config or direct kwargs.

Common situations: Copying a det backbone config into a rec config with an unsupported variant; typo; using a width name from another framework.

Related errors


AI-assisted analysis of opendatalab/MinerU@4fe4bde114 (2026-08-14). Data as JSON: /api/errors/9053602c3e381134. Report an issue: GitHub.