{"record":{"id":"6223e7f4769cde67","repo":"hpcaitech/Open-Sora","slug":"convpixelunshuffle-downsample-is-not-supported-for","errorCode":null,"errorMessage":"ConvPixelUnshuffle downsample is not supported for video","messagePattern":"ConvPixelUnshuffle downsample is not supported for video","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"opensora/models/dc_ae/models/dc_ae.py","lineNumber":198,"sourceCode":"            if temporal_downsample:\n                stride = (2, 2, 2)\n            else:\n                stride = (1, 2, 2)\n        else:\n            stride = 2\n        block = ConvLayer(\n            in_channels=in_channels,\n            out_channels=out_channels,\n            kernel_size=3,\n            stride=stride,\n            use_bias=True,\n            norm=None,\n            act_func=None,\n            is_video=is_video,\n        )\n    elif block_type == \"ConvPixelUnshuffle\":\n        if is_video:\n            raise NotImplementedError(\"ConvPixelUnshuffle downsample is not supported for video\")\n        block = ConvPixelUnshuffleDownSampleLayer(\n            in_channels=in_channels, out_channels=out_channels, kernel_size=3, factor=2\n        )\n    else:\n        raise ValueError(f\"block_type {block_type} is not supported for downsampling\")\n    if shortcut is None:\n        pass\n    elif shortcut == \"averaging\":\n        shortcut_block = PixelUnshuffleChannelAveragingDownSampleLayer(\n            in_channels=in_channels, out_channels=out_channels, factor=2, temporal_downsample=temporal_downsample\n        )\n        block = ResidualBlock(block, shortcut_block)\n    else:\n        raise ValueError(f\"shortcut {shortcut} is not supported for downsample\")\n    return block\n\n\ndef build_upsample_block(","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/hpcaitech/Open-Sora/blob/7ad6a96a135feb81f755c84fb391818718f6beb2/opensora/models/dc_ae/models/dc_ae.py#L180-L216","documentation":"The ConvPixelUnshuffle downsampling layer is only implemented for spatial (4D) inputs; when the autoencoder is constructed in video mode (is_video=True) this path raises NotImplementedError during build_downsample_block. Video tensors (B,C,T,H,W) are incompatible with the pixel-unshuffle conv layout used by this layer.","triggerScenarios":"Building a DCAE with is_video=True (e.g. for video encoding) whose config sets downsample_block_type='ConvPixelUnshuffle'; triggered from build_encoder_project_in_block or Encoder __init__.","commonSituations":"Reusing an image-model dc_ae config (e.g. dc-ae-512 or similar image checkpoints) to run on video; setting is_video in a config that was authored for image models.","solutions":["Switch downsample_block_type to a video-capable layer (e.g. the conv-based downsample used by video configs such as dc-ae-videodata)","Use a video-specific config shipped with the repo","Keep is_video=False if you are only processing images"],"exampleFix":"# before\ndownsample_block_type: ConvPixelUnshuffle  # with is_video: true\n# after\ndownsample_block_type: Conv            # video-capable layer","handlingStrategy":"validation","validationCode":"if is_video:\n    assert downsample_block_type != 'ConvPixelUnshuffle', 'ConvPixelUnshuffle downsample is image-only; use the conv path'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep separate image and video config templates","Add a lint rule forbidding pixel-unshuffle blocks when is_video is true"],"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"}