babysor/MockingBird · critical · Exception

Model folder {ENC_MODELS_DIRT} doesn't exist.

Error message

Model folder {ENC_MODELS_DIRT} doesn't exist.

What it means

Import-time guard in mkgui/train.py for the encoder models directory (ENC_MODELS_DIRT). The training page needs encoder checkpoints listed for its dropdown; absent folder raises at import.

Source

Thrown at control/mkgui/train.py:29

ENC_MODELS_DIRT = f"data{os.sep}ckpt{os.sep}encoder"


# EXT_MODELS_DIRT = f"data{os.sep}ckpt{os.sep}ppg_extractor"
# CONV_MODELS_DIRT = f"data{os.sep}ckpt{os.sep}ppg2mel"
# ENC_MODELS_DIRT = f"data{os.sep}ckpt{os.sep}encoder"

# Pre-Load models
if os.path.isdir(SYN_MODELS_DIRT):    
    synthesizers =  Enum('synthesizers', list((file.name, file) for file in Path(SYN_MODELS_DIRT).glob("**/*.pt")))
    print("Loaded synthesizer models: " + str(len(synthesizers)))
else:
    raise Exception(f"Model folder {SYN_MODELS_DIRT} doesn't exist.")

if os.path.isdir(ENC_MODELS_DIRT):    
    encoders =  Enum('encoders', list((file.name, file) for file in Path(ENC_MODELS_DIRT).glob("**/*.pt")))
    print("Loaded encoders models: " + str(len(encoders)))
else:
    raise Exception(f"Model folder {ENC_MODELS_DIRT} doesn't exist.")

class Model(str, Enum):
    DEFAULT = "default"

class Input(BaseModel):
    model: Model = Field(
        Model.DEFAULT, title="模型类型",
    )
    # datasets_root: str = Field(
    #     ..., alias="预处理数据根目录", description="输入目录(相对/绝对),不适用于ppg2mel模型",
    #     format=True,
    #     example="..\\trainning_data\\"
    # )
    input_root: str = Field(
        ..., alias="输入目录", description="预处理数据根目录",
        format=True,
        example=f"..{os.sep}audiodata{os.sep}SV2TTS{os.sep}synthesizer"
    )

View on GitHub (pinned to 28dc5e14f1)

Solutions

  1. Create the encoder models directory and place the encoder .pt checkpoint in it
  2. Download pretrained models to the expected location
  3. Check ENC_MODELS_DIRT configuration

Example fix

# before: encoder/saved_models missing
mkdir -p encoder/saved_models && cp encoder.pt encoder/saved_models/
# after: 'Loaded encoders models: 1', training page loads
Defensive patterns

Strategy: validation

Validate before calling

enc_dir = Path(ENC_MODELS_DIRT)
if not enc_dir.is_dir() or not list(enc_dir.glob('*.pt')):
    raise SystemExit(f'Encoder models missing in {enc_dir}')

Prevention

When it happens

Trigger: Loading the mkgui training page with no encoder models directory.

Common situations: Pretrained encoder weights not present; wrong models root in config; first run after clone.

Related errors


AI-assisted analysis of babysor/MockingBird@28dc5e14f1 (2026-08-27). Data as JSON: /api/errors/c70ca8b3a978131d. Report an issue: GitHub.