{"record":{"id":"1130c7e9387d6cd0","repo":"hpcaitech/Open-Sora","slug":"shortcut-shortcut-is-not-supported-for-downsampl","errorCode":null,"errorMessage":"shortcut {shortcut} is not supported for downsample","messagePattern":"shortcut (.+?) is not supported for downsample","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"opensora/models/dc_ae/models/dc_ae.py","lineNumber":212,"sourceCode":"            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(\n    block_type: str,\n    in_channels: int,\n    out_channels: int,\n    shortcut: Optional[str],\n    is_video: bool,\n    temporal_upsample: bool = False,\n) -> nn.Module:\n    if block_type == \"ConvPixelShuffle\":\n        if is_video:\n            raise NotImplementedError(\"ConvPixelShuffle upsample is not supported for video\")\n        block = ConvPixelShuffleUpSampleLayer(\n            in_channels=in_channels, out_channels=out_channels, kernel_size=3, factor=2\n        )\n    elif block_type == \"InterpolateConv\":","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/hpcaitech/Open-Sora/blob/7ad6a96a135feb81f755c84fb391818718f6beb2/opensora/models/dc_ae/models/dc_ae.py#L194-L230","documentation":"The downsample block supports only two shortcut modes: None (no shortcut) and 'averaging' (PixelUnshuffleChannelAveragingDownSampleLayer wrapped in a ResidualBlock). Any other shortcut string in the config raises this ValueError at construction.","triggerScenarios":"Setting shortcut: 'identity' (or any string other than 'averaging') on a downsample stage in the DCAE config; build_downsample_block is called from Encoder __init__ and project-in building.","commonSituations":"Modifying stage configs by hand; assuming identity shortcuts are available because other blocks use them.","solutions":["Set shortcut to null/None or 'averaging' in the downsample stage config","Copy an unmodified repo config for the model you want"],"exampleFix":"# before\nshortcut: identity\n# after\nshortcut: averaging","handlingStrategy":"validation","validationCode":"assert shortcut in (None, 'averaging'), f'unsupported downsample shortcut: {shortcut}'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate shortcut vocabulary per stage type (downsample vs upsample vs project in/out)","Prefer shipped configs over hand-edited ones"],"tags":["config","dc-ae","validation"],"backgroundTag":"invalid-config-value","analyzedSha":"7ad6a96a135feb81f755c84fb391818718f6beb2","analyzedAt":"2026-08-28T16:58:37.171Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}