{"record":{"id":"1dd718e14d622574","repo":"babysor/MockingBird","slug":"unknown-encoder-attn-layer","errorCode":null,"errorMessage":"unknown encoder_attn_layer: ","messagePattern":"unknown encoder_attn_layer: ","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"models/ppg_extractor/encoder/conformer_encoder.py","lineNumber":188,"sourceCode":"\n        if selfattention_layer_type == \"selfattn\":\n            logging.info(\"encoder self-attention layer type = self-attention\")\n            encoder_selfattn_layer = MultiHeadedAttention\n            encoder_selfattn_layer_args = (\n                attention_heads,\n                attention_dim,\n                attention_dropout_rate,\n            )\n        elif selfattention_layer_type == \"rel_selfattn\":\n            assert pos_enc_layer_type == \"rel_pos\"\n            encoder_selfattn_layer = RelPositionMultiHeadedAttention\n            encoder_selfattn_layer_args = (\n                attention_heads,\n                attention_dim,\n                attention_dropout_rate,\n            )\n        else:\n            raise ValueError(\"unknown encoder_attn_layer: \" + selfattention_layer_type)\n\n        convolution_layer = ConvolutionModule\n        convolution_layer_args = (attention_dim, cnn_module_kernel, activation)\n\n        self.encoders = repeat(\n            num_blocks,\n            lambda lnum: EncoderLayer(\n                attention_dim,\n                encoder_selfattn_layer(*encoder_selfattn_layer_args),\n                positionwise_layer(*positionwise_layer_args),\n                positionwise_layer(*positionwise_layer_args) if macaron_style else None,\n                convolution_layer(*convolution_layer_args) if use_cnn_module else None,\n                dropout_rate,\n                normalize_before,\n                concat_after,\n            ),\n        )\n        if self.normalize_before:","sourceCodeStart":170,"sourceCodeEnd":206,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/ppg_extractor/encoder/conformer_encoder.py#L170-L206","documentation":"Raised when selfattention_layer_type in the Conformer encoder is not 'selfattn' or 'rel_selfattn'. The message text ('unknown encoder_attn_layer') is misleading; the failing variable is selfattention_layer_type.","triggerScenarios":"Constructing the conformer encoder with selfattention_layer_type other than 'selfattn'/'rel_selfattn' (e.g. 'context_attn' copied from a transformer config).","commonSituations":"Copying a vanilla transformer/ESPnet ASR config into a conformer training run; misspelled attention type.","solutions":["Set selfattention_layer_type to 'selfattn' or 'rel_selfattn'","If 'rel_selfattn', pair it with pos_enc_layer_type='rel_pos'","Use a conformer reference config from the repo"],"exampleFix":"# before\nselfattention_layer_type: context_attn\n\n# after\nselfattention_layer_type: rel_selfattn\npos_enc_layer_type: rel_pos","handlingStrategy":"validation","validationCode":"assert selfattention_layer_type in ('selfattn', 'rel_selfattn'), selfattention_layer_type\nif selfattention_layer_type == 'rel_selfattn':\n    assert pos_enc_layer_type == 'rel_pos'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Note the misleading message text — log the actual variable when wrapping","Cross-validate pos_enc/selfattn pairs before construction"],"tags":["conformer","encoder","self-attention","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}