{"record":{"id":"88d79b0d10450bc2","repo":"PaddlePaddle/PaddleOCR","slug":"mode-model-name-model-is-not-implemented","errorCode":null,"errorMessage":"mode[{model_name}_model] is not implemented!","messagePattern":"mode\\[(.+?)_model\\] is not implemented!","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"ppocr/modeling/backbones/det_mobilenet_v3.py","lineNumber":87,"sourceCode":"            cls_ch_squeeze = 960\n        elif model_name == \"small\":\n            cfg = [\n                # k, exp, c,  se,     nl,  s,\n                [3, 16, 16, True, \"relu\", 2],\n                [3, 72, 24, False, \"relu\", 2],\n                [3, 88, 24, False, \"relu\", 1],\n                [5, 96, 40, True, \"hardswish\", 2],\n                [5, 240, 40, True, \"hardswish\", 1],\n                [5, 240, 40, True, \"hardswish\", 1],\n                [5, 120, 48, True, \"hardswish\", 1],\n                [5, 144, 48, True, \"hardswish\", 1],\n                [5, 288, 96, True, \"hardswish\", 2],\n                [5, 576, 96, True, \"hardswish\", 1],\n                [5, 576, 96, True, \"hardswish\", 1],\n            ]\n            cls_ch_squeeze = 576\n        else:\n            raise NotImplementedError(\n                \"mode[\" + model_name + \"_model] is not implemented!\"\n            )\n\n        supported_scale = [0.35, 0.5, 0.75, 1.0, 1.25]\n        assert (\n            scale in supported_scale\n        ), \"supported scale are {} but input scale is {}\".format(supported_scale, scale)\n        inplanes = 16\n        # conv1\n        self.conv = ConvBNLayer(\n            in_channels=in_channels,\n            out_channels=make_divisible(inplanes * scale),\n            kernel_size=3,\n            stride=2,\n            padding=1,\n            groups=1,\n            if_act=True,\n            act=\"hardswish\",","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/modeling/backbones/det_mobilenet_v3.py#L69-L105","documentation":"The MobileNetV3 detection backbone selects its inverted-residual block table by model_name and only implements 'large' and 'small' (the SOURCE shows the tail of the 'small' table, cls_ch_squeeze=576). Any other value raises NotImplementedError with the message 'mode[<name>_model] is not implemented!'. Note the message is slightly misleading — it is model_name, not 'mode', that is wrong.","triggerScenarios":"Backbone config Backbone.name=MobileNetV3 with model_name='medium', 'Large' (capitalized), or None; the exception fires during network construction.","commonSituations":"Copying a recognition MobileNetV3 config into a detection config (or vice versa) with an extra/renamed key; case-sensitive typos; assuming intermediate widths exist.","solutions":["Set model_name: large or model_name: small (lowercase) in the det_mobilenet_v3 backbone config","Check for a capitalized variant like 'Large' — the comparison is case-sensitive","Confirm scale is also one of 0.35/0.5/0.75/1.0/1.25, since the next line asserts it"],"exampleFix":"# before\nBackbone:\n  name: MobileNetV3\n  model_name: Medium\n\n# after\nBackbone:\n  name: MobileNetV3\n  model_name: small","handlingStrategy":"validation","validationCode":"model_name = model_name.lower()\nassert model_name in ('large', 'small'), f\"model_name must be 'large' or 'small', got {model_name!r}\"\nbackbone = MobileNetV3(model_name=model_name, scale=scale)","typeGuard":"def is_mobilenet_v3_name(n: str) -> bool:\n    return isinstance(n, str) and n.lower() in ('large', 'small')","tryCatchPattern":null,"preventionTips":["Lowercase model_name defensively before passing it into the backbone","When copying configs between det and rec models, keep the model_name/scale keys consistent","Also pre-check scale in {0.35, 0.5, 0.75, 1.0, 1.25}"],"tags":["config","backbone","mobilenet","text-detection"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}