hpcaitech/Open-Sora · error · ValueError
upsample factor {factor} is not supported for decoder projec
Error message
upsample factor {factor} is not supported for decoder project out What it means
build_decoder_project_out_block only supports project_out factors 1 and 2; any other factor value raises this ValueError when the decoder is constructed.
Source
Thrown at opensora/models/dc_ae/models/dc_ae.py:372
out_channels=out_channels,
kernel_size=3,
stride=1,
use_bias=True,
norm=None,
act_func=None,
is_video=is_video,
)
)
elif factor == 2:
if is_video:
raise NotImplementedError("Upsample during project_out is not supported for video")
layers.append(
build_upsample_block(
block_type=upsample_block_type, in_channels=in_channels, out_channels=out_channels, shortcut=None
)
)
else:
raise ValueError(f"upsample factor {factor} is not supported for decoder project out")
return OpSequential(layers)
class Encoder(nn.Module):
def __init__(self, cfg: EncoderConfig):
super().__init__()
self.cfg = cfg
num_stages = len(cfg.width_list)
self.num_stages = num_stages
assert len(cfg.depth_list) == num_stages
assert len(cfg.width_list) == num_stages
assert isinstance(cfg.block_type, str) or (
isinstance(cfg.block_type, list) and len(cfg.block_type) == num_stages
)
self.project_in = build_encoder_project_in_block(
in_channels=cfg.in_channels,
out_channels=cfg.width_list[0] if cfg.depth_list[0] > 0 else cfg.width_list[1],View on GitHub (pinned to 7ad6a96a13)
Solutions
- Set project_out_factor to 1 or 2
- Use a shipped config for the target checkpoint
- Patch build_decoder_project_out_block locally if a new factor is genuinely required
Example fix
# before project_out_factor: 4 # after project_out_factor: 2
Defensive patterns
Strategy: validation
Validate before calling
assert project_out_factor in (1, 2), f'unsupported project_out factor: {project_out_factor}' Prevention
- Whitelist factor values at config load
- Validate decoder config schema before init
When it happens
Trigger: Setting project_out_factor to 4, 8, or any value besides 1/2 in the DCAE decoder config.
Common situations: Attempting to match a different latent-compression scheme by editing the factor; config drift between opensora versions.
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
- block_type {block_type} is not supported for upsampling
- shortcut {shortcut} is not supported for upsample
AI-assisted analysis of hpcaitech/Open-Sora@7ad6a96a13 (2026-08-28).
Data as JSON: /api/errors/024452bf42c42507.
Report an issue: GitHub.