{"record":{"id":"adac80fb1ca3ea9e","repo":"babysor/MockingBird","slug":"invalid-options-mode-arch","errorCode":null,"errorMessage":"Invalid options: mode={}, arch={}","messagePattern":"Invalid options: mode=(.+?), arch=(.+?)","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"models/ppg2mel/utils/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","sourceCodeStart":421,"sourceCodeEnd":452,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/models/ppg2mel/utils/nets_utils.py#L421-L452","documentation":"Raised by get_subsample in models/ppg2mel/utils/nets_utils.py when the (mode, arch) argument combination falls through all supported branches. Supported combos are mode='asr' with arch in {'vggblstmp','vggblstmp2','vggbgru','vgggru','bgru','blstmp','blstm'} (and similar), plus mode='mdense' with arch='bgru'; anything else is invalid.","triggerScenarios":"Calling get_subsample(mode, arch) with an unsupported arch string such as 'conformer' or 'transformer', or mode='mdense' with arch != 'bgru'.","commonSituations":"Copying an ESPnet config that uses an encoder arch this fork doesn't support; typos in the arch field of a train config YAML; switching from asr to mdense mode without changing arch.","solutions":["Check the mode/arch values in your training config against the branches in get_subsample (models/ppg2mel/utils/nets_utils.py:~400-439)","Fix typos in the arch string (case-sensitive, e.g. 'vggblstmp' not 'VGGBLSTMP')","If you need conformer/transformer, patch get_subsample to handle the arch or use a supported arch"],"exampleFix":"# before\nget_subsample('asr', 'conformer', 24)  # ValueError\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, f'unsupported mode/arch: {mode}/{arch}'","typeGuard":null,"tryCatchPattern":"try:\n    subsample = get_subsample(mode, arch, num_layers)\nexcept ValueError as e:\n    raise ConfigError(f'Bad encoder arch in config: {e}') from e","preventionTips":["Validate config enums at load time before training starts","Keep a whitelist of supported arch strings near your config parser","Unit-test get_subsample over all config combos in CI"],"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"}