hpcaitech/Open-Sora · error · ValueError

block_type {block_type} is not supported for downsampling

Error message

block_type {block_type} is not supported for downsampling

What it means

build_downsample_block received an unknown downsample block_type string. Recognized types are the conv-based downsampler and 'ConvPixelUnshuffle'; anything else is rejected with this ValueError during model construction.

Source

Thrown at opensora/models/dc_ae/models/dc_ae.py:203

            stride = 2
        block = ConvLayer(
            in_channels=in_channels,
            out_channels=out_channels,
            kernel_size=3,
            stride=stride,
            use_bias=True,
            norm=None,
            act_func=None,
            is_video=is_video,
        )
    elif block_type == "ConvPixelUnshuffle":
        if is_video:
            raise NotImplementedError("ConvPixelUnshuffle downsample is not supported for video")
        block = ConvPixelUnshuffleDownSampleLayer(
            in_channels=in_channels, out_channels=out_channels, kernel_size=3, factor=2
        )
    else:
        raise ValueError(f"block_type {block_type} is not supported for downsampling")
    if shortcut is None:
        pass
    elif shortcut == "averaging":
        shortcut_block = PixelUnshuffleChannelAveragingDownSampleLayer(
            in_channels=in_channels, out_channels=out_channels, factor=2, temporal_downsample=temporal_downsample
        )
        block = ResidualBlock(block, shortcut_block)
    else:
        raise ValueError(f"shortcut {shortcut} is not supported for downsample")
    return block


def build_upsample_block(
    block_type: str,
    in_channels: int,
    out_channels: int,
    shortcut: Optional[str],
    is_video: bool,

View on GitHub (pinned to 7ad6a96a13)

Solutions

  1. Verify the downsample_block_type string against the branches in build_downsample_block and correct it
  2. Start from a repo-shipped config for your model variant
  3. Match your opensora version to the config's origin version

Example fix

# before
downsample_block_type: pixel_unshuffle
# after
downsample_block_type: ConvPixelUnshuffle
Defensive patterns

Strategy: validation

Validate before calling

SUPPORTED_DOWN = {'Conv', 'ConvPixelUnshuffle'}  # mirror build_downsample_block
assert cfg['downsample_block_type'] in SUPPORTED_DOWN, cfg['downsample_block_type']

Prevention

When it happens

Trigger: Passing downsample_block_type values like 'PixelShuffle', 'pool', or a typo via the DCAE config into Encoder/Decoder __init__ or build_encoder_project_in_block.

Common situations: Hand-edited configs, configs ported from other repos, or version mismatches where the expected block name changed between releases.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of hpcaitech/Open-Sora@7ad6a96a13 (2026-08-28). Data as JSON: /api/errors/cedf0d4aadd7a49d. Report an issue: GitHub.