{"record":{"id":"e210e47a4d40e5bb","repo":"babysor/MockingBird","slug":"number-of-encoders-needs-to-be-more-than-one","errorCode":null,"errorMessage":"Number of encoders needs to be more than one. {}","messagePattern":"Number of encoders needs to be more than one\\. (.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"models/ppg_extractor/encoders.py","lineNumber":298,"sourceCode":"                                        List of dimensions of inputs, e.g. [83,83]\n    :param List or List of List subsample: subsample factors, e.g. [1,2,2,1,1], or\n                                        List of subsample factors of each encoder. e.g. [[1,2,2,1,1], [1,2,2,1,1]]\n    :rtype torch.nn.Module\n    :return: The encoder module\n    \"\"\"\n    num_encs = getattr(args, \"num_encs\", 1)  # use getattr to keep compatibility\n    if num_encs == 1:\n        # compatible with single encoder asr mode\n        return Encoder(args.etype, idim, args.elayers, args.eunits, args.eprojs, subsample, args.dropout_rate)\n    elif num_encs >= 1:\n        enc_list = torch.nn.ModuleList()\n        for idx in range(num_encs):\n            enc = Encoder(args.etype[idx], idim[idx], args.elayers[idx], args.eunits[idx], args.eprojs, subsample[idx],\n                          args.dropout_rate[idx])\n            enc_list.append(enc)\n        return enc_list\n    else:\n        raise ValueError(\"Number of encoders needs to be more than one. {}\".format(num_encs))\n","sourceCodeStart":280,"sourceCodeEnd":299,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/ppg_extractor/encoders.py#L280-L299","documentation":"encoder_for in models/ppg_extractor/encoders.py builds a list of encoders from args.etype/elayers/eunits arrays; it requires num_encs (= len(args.etype)) > 1 for the multi-encoder branch and rejects num_encs <= 1 here.","triggerScenarios":"Calling encoder_for with args.etype containing a single element (num_encs == 1), or num_encs == 0, while the multi-encoder path expects at least two.","commonSituations":"Using a single-encoder config in code that always routes through the multi-encoder branch; YAML lists not parsed as lists (etype given as a scalar string becomes len==1).","solutions":["Ensure args.etype/elayers/eunits/edropout_rate are lists with at least 2 entries","If you truly have one encoder, call the single-Encoder constructor directly instead of encoder_for","Check how the YAML/argparse parses etype — wrap the value in a list"],"exampleFix":"# before\netype: vggblstmp   # scalar → num_encs=1\n\n# after\netype: [vggblstmp, vggblstmp]\nelayers: [3, 3]","handlingStrategy":"validation","validationCode":"num_encs = len(args.etype) if isinstance(args.etype, (list, tuple)) else 1\nassert num_encs > 1, 'encoder_for requires >=2 encoders; pass etype as a list'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure etype/elayers/eunits are YAML lists","For single-encoder setups, construct Encoder directly"],"tags":["espnet","encoder","config","multi-encoder"],"backgroundTag":"invalid-config-value","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}