lllyasviel/ControlNet · error · NotImplementedError
Parameterization {self.parameterization} not yet supported
Error message
Parameterization {self.parameterization} not yet supported What it means
p_losses must know what the model predicts: 'eps' (noise), 'x0' (clean data), or 'v' (velocity parameterization). An unrecognized parameterization string in the config raises NotImplementedError before loss computation.
Source
Thrown at ldm/models/diffusion/ddpm.py:395
else:
raise NotImplementedError("unknown loss type '{loss_type}'")
return loss
def p_losses(self, x_start, t, noise=None):
noise = default(noise, lambda: torch.randn_like(x_start))
x_noisy = self.q_sample(x_start=x_start, t=t, noise=noise)
model_out = self.model(x_noisy, t)
loss_dict = {}
if self.parameterization == "eps":
target = noise
elif self.parameterization == "x0":
target = x_start
elif self.parameterization == "v":
target = self.get_v(x_start, noise, t)
else:
raise NotImplementedError(f"Parameterization {self.parameterization} not yet supported")
loss = self.get_loss(model_out, target, mean=False).mean(dim=[1, 2, 3])
log_prefix = 'train' if self.training else 'val'
loss_dict.update({f'{log_prefix}/loss_simple': loss.mean()})
loss_simple = loss.mean() * self.l_simple_weight
loss_vlb = (self.lvlb_weights[t] * loss).mean()
loss_dict.update({f'{log_prefix}/loss_vlb': loss_vlb})
loss = loss_simple + self.original_elbo_weight * loss_vlb
loss_dict.update({f'{log_prefix}/loss': loss})
return loss, loss_dict
def forward(self, x, *args, **kwargs):View on GitHub (pinned to ed85cd1e25)
Solutions
- Set parameterization: eps (standard), x0, or v in the diffusion config
- If the key is missing in an old config, add it explicitly rather than relying on defaults
- For a new parameterization, extend p_losses with your target computation
Example fix
# before parameterization: epsilon # after parameterization: eps
Defensive patterns
Strategy: validation
Validate before calling
assert parameterization in ('eps', 'x0', 'v'), f"unsupported parameterization {parameterization!r}" Type guard
def is_valid_parameterization(p: str) -> bool:
return p in ('eps', 'x0', 'v') Prevention
- Pin exact option strings in config templates
- Add explicit parameterization to legacy configs rather than relying on defaults
When it happens
Trigger: Running training/inference with parameters.parameterization set to anything other than 'eps', 'x0', or 'v' (e.g. 'epsilon', 'v-pred', or None).
Common situations: Copying configs from v-prediction forks with different naming; hand-merging YAML configs; older configs omitting parameterization while code requires an exact known string.
Related errors
- unknown loss type '{loss_type}'
- Unsupported noise schedule {}. The schedule needs to be 'dis
- resize_method {self.__resize_method} not implemented
- provide num_res_blocks either as an int (globally constant)
- encoder_posterior of type '{type(encoder_posterior)}' not ye
AI-assisted analysis of lllyasviel/ControlNet@ed85cd1e25 (2026-08-27).
Data as JSON: /api/errors/5d31d9b63ba5a99d.
Report an issue: GitHub.