babysor/MockingBird · error · ValueError
unknown input_layer:
Error message
unknown input_layer:
What it means
The transformer Encoder constructor rejects input_layer values other than 'conv2d', 'conv2d6', 'conv2d8', 'linear', or None.
Source
Thrown at models/ppg_extractor/encoder/encoder.py:131
)
elif input_layer == "vgg2l":
self.embed = VGG2L(idim, attention_dim)
elif input_layer == "embed":
self.embed = torch.nn.Sequential(
torch.nn.Embedding(idim, attention_dim, padding_idx=padding_idx),
pos_enc_class(attention_dim, positional_dropout_rate),
)
elif isinstance(input_layer, torch.nn.Module):
self.embed = torch.nn.Sequential(
input_layer,
pos_enc_class(attention_dim, positional_dropout_rate),
)
elif input_layer is None:
self.embed = torch.nn.Sequential(
pos_enc_class(attention_dim, positional_dropout_rate)
)
else:
raise ValueError("unknown input_layer: " + input_layer)
self.normalize_before = normalize_before
if positionwise_layer_type == "linear":
positionwise_layer = PositionwiseFeedForward
positionwise_layer_args = (
attention_dim,
linear_units,
dropout_rate,
activation,
)
elif positionwise_layer_type == "conv1d":
positionwise_layer = MultiLayeredConv1d
positionwise_layer_args = (
attention_dim,
linear_units,
positionwise_conv_kernel_size,
dropout_rate,
)
elif positionwise_layer_type == "conv1d-linear":View on GitHub (pinned to 28dc5e14f1)
Solutions
- Set input_layer to one of conv2d/conv2d6/conv2d8/linear or null
- Check the config key is under the correct encoder section
Example fix
# before input_layer: embed # after input_layer: conv2d
Defensive patterns
Strategy: validation
Validate before calling
assert input_layer in {'conv2d','conv2d6','conv2d8','linear', None} Prevention
- Check for None (null in YAML) vs string typos
- Keep encoder input_layer consistent with feature dimensionality
When it happens
Trigger: Constructing the ppg_extractor Encoder with an unrecognized input_layer value from config.
Common situations: Typos, or configs copied from newer ESPnet that supports additional input layers (e.g. 'embed').
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- unknown input_layer:
- unknown pos_enc_layer:
- Support only linear or conv1d.
- unknown encoder_attn_layer:
- unknown pos_enc_layer:
AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27).
Data as JSON: /api/errors/bd2ef24678bcc3e7.
Report an issue: GitHub.