{"record":{"id":"e2015f53a4b7304a","repo":"PaddlePaddle/PaddleOCR","slug":"mode-mode-model-is-not-implemented","errorCode":null,"errorMessage":"mode[{mode}_model] is not implemented!","messagePattern":"mode\\[(.+?)_model\\] is not implemented!","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"ppocr/modeling/backbones/rec_micronet.py","lineNumber":551,"sourceCode":"            input_channel = 6\n            stem_groups = 3, 2\n            out_ch = 576\n            activation_cfg[\"init_a\"] = 1.0, 1.0\n            activation_cfg[\"init_b\"] = 0.0, 0.0\n        elif mode == \"M2\":\n            input_channel = 8\n            stem_groups = 4, 2\n            out_ch = 768\n            activation_cfg[\"init_a\"] = 1.0, 1.0\n            activation_cfg[\"init_b\"] = 0.0, 0.0\n        elif mode == \"M3\":\n            input_channel = 12\n            stem_groups = 4, 3\n            out_ch = 432\n            activation_cfg[\"init_a\"] = 1.0, 0.5\n            activation_cfg[\"init_b\"] = 0.0, 0.5\n        else:\n            raise NotImplementedError(\"mode[\" + mode + \"_model] is not implemented!\")\n\n        layers = [StemLayer(3, input_channel, stride=2, groups=stem_groups)]\n\n        for idx, val in enumerate(self.cfgs):\n            s, n, c, ks, c1, c2, g1, g2, c3, g3, g4, y1, y2, y3, r = val\n\n            t1 = (c1, c2)\n            gs1 = (g1, g2)\n            gs2 = (c3, g3, g4)\n            activation_cfg[\"dy\"] = [y1, y2, y3]\n            activation_cfg[\"ratio\"] = r\n\n            output_channel = c\n            layers.append(\n                DYMicroBlock(\n                    input_channel,\n                    output_channel,\n                    kernel_size=ks,","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/PaddlePaddle/PaddleOCR/blob/2661c7c0ef5c613e8f93c6e93b2e052399f0f854/ppocr/modeling/backbones/rec_micronet.py#L533-L569","documentation":"MicroNet recognition backbone implements four fixed architectures selected by the mode string: 'M0', 'M1', 'M2', 'M3' (the SOURCE shows the M2/M3 branches setting input_channel, stem_groups, out_ch, activation_cfg). Any other value raises NotImplementedError('mode[<mode>_model] is not implemented!') at construction.","triggerScenarios":"Backbone config with mode='m0' (lowercase), mode='M4', or a typo like 'MO'; also passing the broader model_name/scale-style keys used by MobileNetV3 configs, which MicroNet does not accept.","commonSituations":"Copy-pasting a MobileNetV3 backbone block and only changing name: MicroNet, leaving incompatible keys; case-sensitive YAML values; assuming more variants exist than the four implemented.","solutions":["Set mode to exactly one of 'M0', 'M1', 'M2', 'M3' (uppercase M) in the rec_micronet backbone config","Remove MobileNetV3-only keys (model_name, scale) from the MicroNet backbone block","Prefer M2/M3 as in the shipped configs; verify dims also match a supported preset"],"exampleFix":"# before\nBackbone:\n  name: MicroNet\n  mode: m1        # lowercase -> NotImplementedError\n\n# after\nBackbone:\n  name: MicroNet\n  mode: M1","handlingStrategy":"validation","validationCode":"assert mode in ('M0', 'M1', 'M2', 'M3'), f'MicroNet mode must be M0-M3, got {mode!r}'","typeGuard":"def is_micronet_mode(m: str) -> bool:\n    return m in {'M0', 'M1', 'M2', 'M3'}","tryCatchPattern":null,"preventionTips":["Use exact uppercase 'M0'..'M3'; lowercase fails","Don't mix MobileNetV3 keys (model_name/scale) into the MicroNet backbone block","Start from a shipped rec_micronet config and change only what you need"],"tags":["config","backbone","micronet","recognition","enum-value"],"backgroundTag":null,"analyzedSha":"2661c7c0ef5c613e8f93c6e93b2e052399f0f854","analyzedAt":"2026-08-14T20:17:30.180Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}