{"record":{"id":"bc038584bdac001e","repo":"babysor/MockingBird","slug":"model-folder-syn-models-dirt-doesn-t-exist-bc0385","errorCode":null,"errorMessage":"Model folder {SYN_MODELS_DIRT} doesn't exist.","messagePattern":"Model folder (.+?) doesn't exist\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"critical","filePath":"control/mkgui/train.py","lineNumber":23,"sourceCode":"from typing import Any\nfrom models.synthesizer.hparams import hparams\nfrom models.synthesizer.train import train as synt_train\n\n# Constants\nSYN_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}synthesizer\"\nENC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}encoder\"\n\n\n# EXT_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}ppg_extractor\"\n# CONV_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}ppg2mel\"\n# ENC_MODELS_DIRT = f\"data{os.sep}ckpt{os.sep}encoder\"\n\n# Pre-Load models\nif os.path.isdir(SYN_MODELS_DIRT):    \n    synthesizers =  Enum('synthesizers', list((file.name, file) for file in Path(SYN_MODELS_DIRT).glob(\"**/*.pt\")))\n    print(\"Loaded synthesizer models: \" + str(len(synthesizers)))\nelse:\n    raise Exception(f\"Model folder {SYN_MODELS_DIRT} doesn't exist.\")\n\nif os.path.isdir(ENC_MODELS_DIRT):    \n    encoders =  Enum('encoders', list((file.name, file) for file in Path(ENC_MODELS_DIRT).glob(\"**/*.pt\")))\n    print(\"Loaded encoders models: \" + str(len(encoders)))\nelse:\n    raise Exception(f\"Model folder {ENC_MODELS_DIRT} doesn't exist.\")\n\nclass Model(str, Enum):\n    DEFAULT = \"default\"\n\nclass Input(BaseModel):\n    model: Model = Field(\n        Model.DEFAULT, title=\"模型类型\",\n    )\n    # datasets_root: str = Field(\n    #     ..., alias=\"预处理数据根目录\", description=\"输入目录（相对/绝对）,不适用于ppg2mel模型\",\n    #     format=True,\n    #     example=\"..\\\\trainning_data\\\\\"","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/babysor/MockingBird/blob/28dc5e14f12d7c754612af2fde8e78a4b03f8616/control/mkgui/train.py#L5-L41","documentation":"Import-time guard in mkgui/train.py: the training page enumerates synthesizer checkpoints (*.pt, recursive) under SYN_MODELS_DIRT to let you fine-tune from one; a missing directory aborts module import.","triggerScenarios":"Opening the mkgui training page when no synthesizer models directory exists.","commonSituations":"Trying to fine-tune before any base synthesizer model exists; models path misconfigured; fresh clone.","solutions":["Create the synthesizer models directory with at least one .pt checkpoint (e.g. a pretrained base model to fine-tune from)","Download the pretrained synthesizer to the expected path","Verify SYN_MODELS_DIRT points to your checkpoints root"],"exampleFix":"# before: encoder/saved_models/synthesizer missing\nmkdir -p encoder/saved_models/synthesizer && cp pretrained.pt encoder/saved_models/synthesizer/\n# after: 'Loaded synthesizer models: 1', training page loads","handlingStrategy":"validation","validationCode":"syn_dir = Path(SYN_MODELS_DIRT)\nif not syn_dir.is_dir() or not list(syn_dir.glob('**/*.pt')):\n    raise SystemExit(f'Synthesizer models missing in {syn_dir}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Place a base pretrained synthesizer .pt before enabling fine-tune UI","Preflight-check model dirs at startup","Keep checkpoints saved in the expected directory layout"],"tags":["python","models","filesystem","mkgui","training"],"backgroundTag":"missing-model-directory","analyzedSha":"28dc5e14f12d7c754612af2fde8e78a4b03f8616","analyzedAt":"2026-08-27T02:26:53.589Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}