hpcaitech/Open-Sora · error · ValueError

shortcut {shortcut} is not supported for upsample

Error message

shortcut {shortcut} is not supported for upsample

What it means

The upsample block supports only None and 'duplicating' (ChannelDuplicatingPixelShuffleUpSampleLayer) as shortcut modes. Other shortcut values are rejected with this ValueError when the decoder is built.

Source

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

        block = InterpolateConvUpSampleLayer(
            in_channels=in_channels,
            out_channels=out_channels,
            kernel_size=3,
            factor=2,
            is_video=is_video,
            temporal_upsample=temporal_upsample,
        )
    else:
        raise ValueError(f"block_type {block_type} is not supported for upsampling")
    if shortcut is None:
        pass
    elif shortcut == "duplicating":
        shortcut_block = ChannelDuplicatingPixelShuffleUpSampleLayer(
            in_channels=in_channels, out_channels=out_channels, factor=2, temporal_upsample=temporal_upsample
        )
        block = ResidualBlock(block, shortcut_block)
    else:
        raise ValueError(f"shortcut {shortcut} is not supported for upsample")
    return block


def build_encoder_project_in_block(
    in_channels: int, out_channels: int, factor: int, downsample_block_type: str, is_video: bool
):
    if factor == 1:
        block = ConvLayer(
            in_channels=in_channels,
            out_channels=out_channels,
            kernel_size=3,
            stride=1,
            use_bias=True,
            norm=None,
            act_func=None,
            is_video=is_video,
        )
    elif factor == 2:

View on GitHub (pinned to 7ad6a96a13)

Solutions

  1. Set shortcut to null/None or 'duplicating' in the upsample stage config
  2. Use an unmodified shipped config

Example fix

# before
shortcut: averaging   # on an upsample stage
# after
shortcut: duplicating
Defensive patterns

Strategy: validation

Validate before calling

assert shortcut in (None, 'duplicating'), f'unsupported upsample shortcut: {shortcut}'

Prevention

When it happens

Trigger: Setting shortcut: 'identity' or another unsupported string on an upsample stage in the decoder config; called from Decoder __init__ and build_decoder_project_out_block.

Common situations: Hand-editing decoder stage configs; assuming shortcut vocabulary from the downsample path ('averaging') applies to upsampling.

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/7f5cfec620bb93f4. Report an issue: GitHub.