babysor/MockingBird · error · ValueError

unknown input_layer:

Error message

unknown input_layer: 

What it means

Raised by the Conformer encoder constructor when input_layer is not one of 'conv2d', 'conv2d6', 'conv2d8', 'linear', or None.

Source

Thrown at models/ppg_extractor/encoder/conformer_encoder.py:142

                )
        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

  1. Use one of: 'conv2d', 'conv2d6', 'conv2d8', 'linear', or null
  2. Diff your config against a working conformer example in this repo
  3. Upgrade/patch conformer_encoder.py if you need a newer ESPnet input_layer option

Example fix

# before
input_layer: conv2d2

# after
input_layer: conv2d6
Defensive patterns

Strategy: validation

Validate before calling

allowed = {'conv2d', 'conv2d6', 'conv2d8', 'linear', None}
assert input_layer in allowed, repr(input_layer)

Prevention

When it happens

Trigger: Constructing the encoder with an unrecognized input_layer value, e.g. 'conv2d2' or 'embed', or a non-None non-string value.

Common situations: ESPnet config drift (newer ESPnet supports values like 'conv2d1' or 'embed'); typo in YAML; configs copied from transformer encoder expecting different input layer names.

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


AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27). Data as JSON: /api/errors/6e5e8d628f613a57. Report an issue: GitHub.