{"record":{"id":"eec84f2714580a94","repo":"lllyasviel/Fooocus","slug":"upsample-mode-upsampler-is-not-found","errorCode":null,"errorMessage":"upsample mode [{upsampler}] is not found","messagePattern":"upsample mode \\[(.+?)\\] is not found","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"ldm_patched/pfn/architecture/SPSR.py","lineNumber":104,"sourceCode":"                mode=\"CNA\",\n            )\n            for _ in range(self.num_blocks)\n        ]\n        LR_conv = B.conv_block(\n            self.num_filters,\n            self.num_filters,\n            kernel_size=3,\n            norm_type=norm,\n            act_type=None,\n            mode=mode,\n        )\n\n        if upsampler == \"upconv\":\n            upsample_block = B.upconv_block\n        elif upsampler == \"pixelshuffle\":\n            upsample_block = B.pixelshuffle_block\n        else:\n            raise NotImplementedError(f\"upsample mode [{upsampler}] is not found\")\n        if self.scale == 3:\n            a_upsampler = upsample_block(\n                self.num_filters, self.num_filters, 3, act_type=act\n            )\n        else:\n            a_upsampler = [\n                upsample_block(self.num_filters, self.num_filters, act_type=act)\n                for _ in range(n_upscale)\n            ]\n        self.HR_conv0_new = B.conv_block(\n            self.num_filters,\n            self.num_filters,\n            kernel_size=3,\n            norm_type=None,\n            act_type=act,\n        )\n        self.HR_conv1_new = B.conv_block(\n            self.num_filters,","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/lllyasviel/Fooocus/blob/ae05379cc97bc4361ec8b4ec90193dab21be763f/ldm_patched/pfn/architecture/SPSR.py#L86-L122","documentation":"SPSRNet (branch A of SPSR) accepts exactly two upsampler strings: 'upconv' -> B.upconv_block and 'pixelshuffle' -> B.pixelshuffle_block (note: here WITHOUT underscore, unlike RRDBNet in the same repo). Anything else raises NotImplementedError before the upsampling stack is built.","triggerScenarios":"Constructing SPSR with upsampler='pixel_shuffle' (RRDB's spelling), '', or an arbitrary string in the model params dict; typically from a copied upscaler YAML whose spelling does not match this architecture's expectations.","commonSituations":"Cross-pollinating configs between RRDBNet ('pixel_shuffle') and SPSR ('pixelshuffle') upscalers; registering SPSR with nearest/none upsampler intending to skip upsampling.","solutions":["Use upsampler='pixelshuffle' or 'upconv' for SPSR","If porting a config from RRDBNet, change 'pixel_shuffle' to 'pixelshuffle' when targeting SPSR"],"exampleFix":"# before\nnet = SPSRNet(..., upsampler='pixel_shuffle')  # -> NotImplementedError\n\n# after\nnet = SPSRNet(..., upsampler='pixelshuffle')","handlingStrategy":"validation","validationCode":"SPSR_UPSAMPLERS = {'upconv', 'pixelshuffle'}\n\nupsampler = cfg.get('upsampler', 'upconv')\nif upsampler == 'pixel_shuffle':  # tolerate RRDB-style spelling\n    upsampler = 'pixelshuffle'\nassert upsampler in SPSR_UPSAMPLERS, f'SPSR upsampler must be one of {SPSR_UPSAMPLERS}'","typeGuard":"def is_valid_spsr_upsampler(name: str) -> bool:\n    return name in ('upconv', 'pixelshuffle')","tryCatchPattern":null,"preventionTips":["SPSR expects 'pixelshuffle' with NO underscore","Validate the upsampler string against the target architecture's accepted set before construction"],"tags":["super-resolution","spsr","upsampler","config","naming"],"backgroundTag":null,"analyzedSha":"ae05379cc97bc4361ec8b4ec90193dab21be763f","analyzedAt":"2026-08-15T04:23:59.533Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}