{"record":{"id":"36e8bfe198364249","repo":"babysor/MockingBird","slug":"invalid-options-mode-arch-36e8bf","errorCode":null,"errorMessage":"Invalid options: mode={}, arch={}","messagePattern":"Invalid options: mode=(.+?), arch=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"models/ppg_extractor/nets_utils.py","lineNumber":439,"sourceCode":"\n    elif mode == 'asr' and arch == 'rnn_mulenc':\n        subsample_list = []\n        for idx in range(train_args.num_encs):\n            subsample = np.ones(train_args.elayers[idx] + 1, dtype=np.int)\n            if train_args.etype[idx].endswith(\"p\") and not train_args.etype[idx].startswith(\"vgg\"):\n                ss = train_args.subsample[idx].split(\"_\")\n                for j in range(min(train_args.elayers[idx] + 1, len(ss))):\n                    subsample[j] = int(ss[j])\n            else:\n                logging.warning(\n                    'Encoder %d: Subsampling is not performed for vgg*. '\n                    'It is performed in max pooling layers at CNN.', idx + 1)\n            logging.info('subsample: ' + ' '.join([str(x) for x in subsample]))\n            subsample_list.append(subsample)\n        return subsample_list\n\n    else:\n        raise ValueError('Invalid options: mode={}, arch={}'.format(mode, arch))\n\n\ndef rename_state_dict(old_prefix: str, new_prefix: str, state_dict: Dict[str, torch.Tensor]):\n    \"\"\"Replace keys of old prefix with new prefix in state dict.\"\"\"\n    # need this list not to break the dict iterator\n    old_keys = [k for k in state_dict if k.startswith(old_prefix)]\n    if len(old_keys) > 0:\n        logging.warning(f'Rename: {old_prefix} -> {new_prefix}')\n    for k in old_keys:\n        v = state_dict.pop(k)\n        new_k = k.replace(old_prefix, new_prefix)\n        state_dict[new_k] = v\n\ndef get_activation(act):\n    \"\"\"Return activation function.\"\"\"\n    # Lazy load to avoid unused import\n    from .encoder.swish import Swish\n","sourceCodeStart":421,"sourceCodeEnd":457,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/ppg_extractor/nets_utils.py#L421-L457","documentation":"Identical logic to the ppg2mel copy: get_subsample in models/ppg_extractor/nets_utils.py rejects unsupported (mode, arch) pairs, e.g. anything besides asr/{vggblstmp,vggblstmp2,vggbgru,vgggru,bgru,blstmp,blstm} and mdense/bgru.","triggerScenarios":"Calling get_subsample with mode='asr' and an arch like 'conformer'/'transformer', or mode='mdense' with arch != 'bgru'.","commonSituations":"Adapting ESPnet2/conformer configs into this codebase; arch typo; wrong mode string.","solutions":["Match (mode, arch) to a supported combination, e.g. ('asr','vggblstmp')","Patch get_subsample to add a branch for your arch if genuinely needed"],"exampleFix":"# before\nget_subsample('asr', 'transformer', 24)\n\n# after\nget_subsample('asr', 'vggblstmp', 24)","handlingStrategy":"validation","validationCode":"VALID = {('asr', a) for a in ['vggblstmp','vggblstmp2','vggbgru','vgggru','bgru','blstmp','blstm']} | {('mdense','bgru')}\nassert (mode, arch) in VALID","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate config before training launch","Add regression tests covering every supported (mode, arch)"],"tags":["espnet","config","subsample","valueerror"],"backgroundTag":"invalid-config-value","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}