{"record":{"id":"e47642be83aec8b2","repo":"hpcaitech/Open-Sora","slug":"downsample-during-project-in-is-not-supported-for","errorCode":null,"errorMessage":"Downsample during project_in is not supported for video","messagePattern":"Downsample during project_in is not supported for video","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"opensora/models/dc_ae/models/dc_ae.py","lineNumber":269,"sourceCode":"\n\ndef build_encoder_project_in_block(\n    in_channels: int, out_channels: int, factor: int, downsample_block_type: str, is_video: bool\n):\n    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        [","sourceCodeStart":251,"sourceCodeEnd":287,"githubUrl":"https://github.com/hpcaitech/Open-Sora/blob/7ad6a96a135feb81f755c84fb391818718f6beb2/opensora/models/dc_ae/models/dc_ae.py#L251-L287","documentation":"When the encoder's project_in has spatial factor 2, the code falls back to a pixel-unshuffle-style downsample that is not implemented for 5D video tensors; constructing a video DCAE with in_video mode and factor=2 project_in raises NotImplementedError. Video configs should use the video-capable project_in path (factor 1 conv or the video branch).","triggerScenarios":"Building a DCAE with is_video=True and project_in_factor: 2 in the encoder config; build_encoder_project_in_block is called from Encoder __init__.","commonSituations":"Reusing an image-model config (which uses factor 2 to pre-downsample) with is_video enabled for video generation/encoding.","solutions":["Set the encoder project_in factor appropriate for video configs (use the video-capable setting, typically factor 1 / conv-only)","Use a video DCAE config shipped with the repo","Keep is_video=False when using factor 2 project_in on images"],"exampleFix":"# before\nproject_in_factor: 2   # with is_video: true\n# after\nproject_in_factor: 1","handlingStrategy":"validation","validationCode":"if is_video:\n    assert project_in_factor == 1, 'factor-2 project_in downsample is not implemented for video'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use video-specific configs","Add an is_video cross-check over factor fields at config validation time"],"tags":["dc-ae","video","not-implemented","config"],"backgroundTag":"unsupported-operation-for-input-type","analyzedSha":"7ad6a96a135feb81f755c84fb391818718f6beb2","analyzedAt":"2026-08-28T16:58:37.171Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}