hpcaitech/Open-Sora · error · ValueError
block_type {block_type} is not supported for upsampling
Error message
block_type {block_type} is not supported for upsampling What it means
build_upsample_block only supports 'ConvPixelShuffle' and 'InterpolateConv' as upsample block types; any other string raises this ValueError when the decoder is constructed.
Source
Thrown at opensora/models/dc_ae/models/dc_ae.py:240
temporal_upsample: bool = False,
) -> nn.Module:
if block_type == "ConvPixelShuffle":
if is_video:
raise NotImplementedError("ConvPixelShuffle upsample is not supported for video")
block = ConvPixelShuffleUpSampleLayer(
in_channels=in_channels, out_channels=out_channels, kernel_size=3, factor=2
)
elif block_type == "InterpolateConv":
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,View on GitHub (pinned to 7ad6a96a13)
Solutions
- Correct upsample_block_type to 'ConvPixelShuffle' (images) or 'InterpolateConv' (video)
- Start from a shipped config matching your model variant
- Align opensora version with the config source
Example fix
# before upsample_block_type: pixelshuffle # after upsample_block_type: ConvPixelShuffle
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED_UP = {'ConvPixelShuffle', 'InterpolateConv'}
assert cfg['upsample_block_type'] in SUPPORTED_UP, cfg['upsample_block_type'] Prevention
- Whitelist-check upsample names at config load
- Use shipped configs; pin versions
When it happens
Trigger: Passing an unknown upsample_block_type (e.g. 'NearestConv', 'PixelShuffle', a typo) from the DCAE config into the decoder build path.
Common situations: Hand-written or ported configs; version skew between config files and the supported block list in this version of opensora.
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
- block_type {block_type} is not supported
- block_type {block_type} is not supported for downsampling
- shortcut {shortcut} is not supported for downsample
- shortcut {shortcut} is not supported for upsample
- downsample factor {factor} is not supported for encoder proj
AI-assisted analysis of hpcaitech/Open-Sora@7ad6a96a13 (2026-08-28).
Data as JSON: /api/errors/08c0fae21eb837c9.
Report an issue: GitHub.