hpcaitech/Open-Sora · error · ValueError

shortcut {shortcut} is not supported for encoder project out

Error message

shortcut {shortcut} is not supported for encoder project out

What it means

The encoder project_out block supports only None and 'averaging' shortcut modes. Any other shortcut string in the encoder's project_out config raises this ValueError during Encoder construction.

Source

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

                out_channels=out_channels,
                kernel_size=3,
                stride=1,
                use_bias=True,
                norm=None,
                act_func=None,
                is_video=is_video,
            ),
        ]
    )
    if shortcut is None:
        pass
    elif shortcut == "averaging":
        shortcut_block = PixelUnshuffleChannelAveragingDownSampleLayer(
            in_channels=in_channels, out_channels=out_channels, factor=1
        )
        block = ResidualBlock(block, shortcut_block)
    else:
        raise ValueError(f"shortcut {shortcut} is not supported for encoder project out")
    return block


def build_decoder_project_in_block(in_channels: int, out_channels: int, shortcut: Optional[str], is_video: bool):
    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,
    )
    if shortcut is None:
        pass
    elif shortcut == "duplicating":
        shortcut_block = ChannelDuplicatingPixelShuffleUpSampleLayer(

View on GitHub (pinned to 7ad6a96a13)

Solutions

  1. Set the encoder project_out shortcut to null/None or 'averaging'
  2. Validate the whole config against a shipped example before model init

Example fix

# before
shortcut: duplicating   # encoder project_out
# after
shortcut: averaging
Defensive patterns

Strategy: validation

Validate before calling

assert shortcut in (None, 'averaging'), f'unsupported encoder project_out shortcut: {shortcut}'

Prevention

When it happens

Trigger: Setting project_out shortcut to a value other than null or 'averaging' (e.g. 'identity', 'duplicating') in the DCAE encoder config.

Common situations: Copy-pasting shortcut settings between encoder/decoder stages whose allowed vocabularies differ; hand-edited configs.

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