babysor/MockingBird · error · NotImplementedError
Support only linear or conv1d.
Error message
Support only linear or conv1d.
What it means
Raised when positionwise_layer_type in the Conformer encoder is neither 'linear' (PositionwiseFeedForward) nor 'conv1d' (ConvolutionalPositionwiseFeedForward).
Source
Thrown at models/ppg_extractor/encoder/conformer_encoder.py:169
)
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":
positionwise_layer = Conv1dLinear
positionwise_layer_args = (
attention_dim,
linear_units,
positionwise_conv_kernel_size,
dropout_rate,
)
else:
raise NotImplementedError("Support only linear or conv1d.")
if selfattention_layer_type == "selfattn":
logging.info("encoder self-attention layer type = self-attention")
encoder_selfattn_layer = MultiHeadedAttention
encoder_selfattn_layer_args = (
attention_heads,
attention_dim,
attention_dropout_rate,
)
elif selfattention_layer_type == "rel_selfattn":
assert pos_enc_layer_type == "rel_pos"
encoder_selfattn_layer = RelPositionMultiHeadedAttention
encoder_selfattn_layer_args = (
attention_heads,
attention_dim,
attention_dropout_rate,
)
else:View on GitHub (pinned to 28dc5e14f1)
Solutions
- Set positionwise_layer_type to 'linear' or 'conv1d' (conformer default is usually 'conv1d')
- Verify the YAML key spelling (positionwise_layer_type, not positionwise_type)
Example fix
# before positionwise_layer_type: conv # after positionwise_layer_type: conv1d
Defensive patterns
Strategy: validation
Validate before calling
assert positionwise_layer_type in ('linear', 'conv1d'), positionwise_layer_type Prevention
- Pin config presets known to work
- Validate all *_layer_type fields in one pass at startup
When it happens
Trigger: Constructing the conformer encoder with positionwise_layer_type set to anything other than 'linear' or 'conv1d'.
Common situations: Config typos like 'conv1' or 'ffn'; copying configs from other ESPnet forks with extra positionwise types.
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 pos_enc_layer:
- unknown input_layer:
- unknown encoder_attn_layer:
- Support only linear or conv1d.
- unknown pos_enc_layer:
AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27).
Data as JSON: /api/errors/2ca7ac65c5052e2c.
Report an issue: GitHub.