{"record":{"id":"1b3e8999ee881895","repo":"hpcaitech/Open-Sora","slug":"downsample-factor-factor-is-not-supported-for-en","errorCode":null,"errorMessage":"downsample factor {factor} is not supported for encoder project in","messagePattern":"downsample factor (.+?) is not supported for encoder project in","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"opensora/models/dc_ae/models/dc_ae.py","lineNumber":274,"sourceCode":"    if factor == 1:\n        block = ConvLayer(\n            in_channels=in_channels,\n            out_channels=out_channels,\n            kernel_size=3,\n            stride=1,\n            use_bias=True,\n            norm=None,\n            act_func=None,\n            is_video=is_video,\n        )\n    elif factor == 2:\n        if is_video:\n            raise NotImplementedError(\"Downsample during project_in is not supported for video\")\n        block = build_downsample_block(\n            block_type=downsample_block_type, in_channels=in_channels, out_channels=out_channels, shortcut=None\n        )\n    else:\n        raise ValueError(f\"downsample factor {factor} is not supported for encoder project in\")\n    return block\n\n\ndef build_encoder_project_out_block(\n    in_channels: int,\n    out_channels: int,\n    norm: Optional[str],\n    act: Optional[str],\n    shortcut: Optional[str],\n    is_video: bool,\n):\n    block = OpSequential(\n        [\n            build_norm(norm),\n            build_act(act),\n            ConvLayer(\n                in_channels=in_channels,\n                out_channels=out_channels,","sourceCodeStart":256,"sourceCodeEnd":292,"githubUrl":"https://github.com/hpcaitech/Open-Sora/blob/7ad6a96a135feb81f755c84fb391818718f6beb2/opensora/models/dc_ae/models/dc_ae.py#L256-L292","documentation":"build_encoder_project_in_block only supports project_in factors 1 and 2. Any other factor value in the encoder config raises this ValueError at model construction.","triggerScenarios":"Setting project_in_factor to 4, 8, 0.5, or any value besides 1/2 in the DCAE encoder config.","commonSituations":"Trying to match a different VAE's channel/stride scheme by changing the project-in factor; hand-editing configs without checking supported values.","solutions":["Set project_in_factor to 1 or 2","Use a shipped config for the target checkpoint","If you need another factor, implement it in build_encoder_project_in_block and contribute/patch locally"],"exampleFix":"# before\nproject_in_factor: 4\n# after\nproject_in_factor: 2","handlingStrategy":"validation","validationCode":"assert project_in_factor in (1, 2), f'unsupported project_in factor: {project_in_factor}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Whitelist factor values at config load","Validate the full encoder config schema before init"],"tags":["config","dc-ae","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"7ad6a96a135feb81f755c84fb391818718f6beb2","analyzedAt":"2026-08-28T16:58:37.171Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}