hpcaitech/Open-Sora · error · ValueError
block_type {block_type} is not supported
Error message
block_type {block_type} is not supported What it means
The deep-compression autoencoder block factory build_block does not recognize the requested block_type string. Supported names include variants like 'EViTS5_GLU'; anything else (typo, unsupported architecture, wrong config key) falls through to this ValueError at model construction time.
Source
Thrown at opensora/models/dc_ae/models/dc_ae.py:143
stride=1,
use_bias=(True, False),
norm=(None, norm),
act_func=(act, None),
is_video=is_video,
)
block = ResidualBlock(main_block, IdentityLayer())
elif block_type == "EViT_GLU":
assert in_channels == out_channels
block = EfficientViTBlock(
in_channels, norm=norm, act_func=act, local_module="GLUMBConv", scales=(), is_video=is_video
)
elif block_type == "EViTS5_GLU":
assert in_channels == out_channels
block = EfficientViTBlock(
in_channels, norm=norm, act_func=act, local_module="GLUMBConv", scales=(5,), is_video=is_video
)
else:
raise ValueError(f"block_type {block_type} is not supported")
return block
def build_stage_main(
width: int, depth: int, block_type: str | list[str], norm: str, act: str, input_width: int, is_video: bool
) -> list[nn.Module]:
assert isinstance(block_type, str) or (isinstance(block_type, list) and depth == len(block_type))
stage = []
for d in range(depth):
current_block_type = block_type[d] if isinstance(block_type, list) else block_type
block = build_block(
block_type=current_block_type,
in_channels=width if d > 0 else input_width,
out_channels=width,
norm=norm,
act=act,
is_video=is_video,
)View on GitHub (pinned to 7ad6a96a13)
Solutions
- Check the spelling against the supported list in build_block (e.g. 'EViTS5_GLU') and fix the config
- Use a config shipped with the repo for the target model variant
- Upgrade/downgrade opensora so its build_block supports the block names your config references
Example fix
# before block_type: ['ResBlock', 'EViTS5_GLU'] # after block_type: ['EViTS5_GLU', 'EViTS5_GLU']
Defensive patterns
Strategy: validation
Validate before calling
SUPPORTED_BLOCKS = {'EViTS5_GLU', ...} # mirror build_block branches
assert all(b in SUPPORTED_BLOCKS for b in cfg['block_type']), f'unsupported block(s): {set(cfg["block_type"]) - SUPPORTED_BLOCKS}' Prevention
- Validate block_type lists against a whitelist before model init
- Use shipped configs as the source of truth
- Add config schema validation at load time
When it happens
Trigger: Instantiating the DCAE encoder/decoder with a config whose block list contains an unknown string, e.g. 'ResBlock', 'EViTS4_GLU', or a misspelled 'EViTS5GLU'; build_stage_main calls build_block per configured block.
Common situations: Editing or hand-writing a dc_ae YAML/JSON config; porting configs from a different autoencoder repo whose block names differ; version skew where a config uses block names not yet present in this code version.
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 for downsampling
- shortcut {shortcut} is not supported for downsample
- block_type {block_type} is not supported for upsampling
- 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/080d05317136ae27.
Report an issue: GitHub.