{"record":{"id":"6b7a7da7b2d19c91","repo":"PaddlePaddle/PaddleOCR","slug":"mode-model-name-model-is-not-implemented-6b7a7d","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/rec_mobilenet_v3.py","lineNumber":94,"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\", (small_stride[0], 1)],\n                [3, 72, 24, False, \"relu\", (small_stride[1], 1)],\n                [3, 88, 24, False, \"relu\", 1],\n                [5, 96, 40, True, \"hardswish\", (small_stride[2], 1)],\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\", (small_stride[3], 1)],\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 scales are {} but input scale is {}\".format(\n            supported_scale, scale\n        )\n\n        inplanes = 16\n        # conv1\n        self.conv1 = ConvBNLayer(\n            in_channels=in_channels,\n            out_channels=make_divisible(inplanes * scale),\n            kernel_size=3,\n            stride=2,\n            padding=1,","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/modeling/backbones/rec_mobilenet_v3.py#L76-L112","documentation":"MobileNetV3 recognition backbone mirrors the detection variant: only model_name 'large' and 'small' have block tables (SOURCE ends the 'small' table with cls_ch_squeeze=576). Any other model_name raises NotImplementedError('mode[<name>_model] is not implemented!') during network build; the immediately following assert then validates scale in {0.35, 0.5, 0.75, 1.0, 1.25}.","triggerScenarios":"Rec backbone config with model_name='Large' (case-sensitive), 'medium', or missing model_name; or editing small_stride lists but not model_name, resulting in an unused/wrong variant name.","commonSituations":"Config drift between det and rec MobileNetV3 blocks; capitalization typos; removing model_name while copying a minimal config.","solutions":["Set model_name: large or model_name: small (exact lowercase) in the rec_mobilenet_v3 config","Also verify scale is one of 0.35/0.5/0.75/1.0/1.25 to pass the next assertion"],"exampleFix":"# before\nBackbone:\n  name: MobileNetV3\n  model_name: Large\n\n# after\nBackbone:\n  name: MobileNetV3\n  model_name: large","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}\"","typeGuard":"def is_mobilenet_v3_name(n: str) -> bool:\n    return isinstance(n, str) and n.lower() in ('large', 'small')","tryCatchPattern":null,"preventionTips":["Lowercase the config value before passing it in","Pre-check scale against {0.35, 0.5, 0.75, 1.0, 1.25} in the same validation step","Instantiate backbones in a config smoke test to catch enum typos at CI time"],"tags":["config","backbone","mobilenet","recognition"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}