← ClaudeAtlas

dataset-doctorlisted

Audit a LoRA training dataset and its captions before training on lora-scripts-next / SD-Trainer (Anima-first), and fix the findings with safe one-line commands. Use when the user wants to check / validate / inspect / fix / clean / 体检 / 修 a dataset, captions, or tags for LoRA training — image count, repeats and the training step budget, resolution and aspect-ratio buckets, duplicate or corrupt or non-RGB images, missing or empty or inconsistent captions, trigger-word consistency, and tag-frequency distribution. Runs read-only scan scripts, returns a PASS / WARN / FAIL readiness report with prioritized fixes, and applies confirmed fixes via fix_dataset.py (dry-run by default; originals quarantined, never deleted), including WD14 re-tagging via the trainer API.
Rinne414/lora-training-skill · ★ 14 · Data & Documents · score 78
Install: claude install-skill Rinne414/lora-training-skill
# dataset-doctor — LoRA 数据集 / caption 体检 + 修复 在训练前对 LoRA 数据集与标注做质量体检,给出 **PASS / WARN / FAIL** 结论和按优先级排序的修复建议;确认后用 `fix_dataset.py` 一行命令执行修复。**体检只读**;修复**默认 dry-run**,加 `--apply` 才动文件,且**从不删除**——被移除的文件全部进数据集内的 `_quarantine/`(体检与训练都会忽略它),随时可还原。任何 `--apply` 都必须先得到用户确认。 底层针对 `lora-scripts-next`(SD-Trainer)的数据集约定:`train_data_dir` 下放 `<repeats>_<concept>` 子文件夹(如 `7_zkz` = 重复 7 次、概念 `zkz`),caption 是与图同名的 sidecar `.txt`——**单行**、逗号分隔、可在末尾用「`. `」接自然语言(已验证格式见 `../references/caption-guide.md`)。Anima `.json` caption 仅是 UI 宣称的可选项,训练端 v2.7.0 未发现读取实现,不要依赖。 ## 默认职责 接收一个数据集路径,运行体检脚本,解读 JSON/报告,向用户说明问题与修复顺序;用户确认后用 `fix_dataset.py` 执行修复并重检。trainer 本身**只检查目录是否存在、有没有图**,不检查质量——质量这块由本 skill 负责,二者互补。 ## 适用范围(不限 SD-Trainer) 体检与修复是**训练器无关**的:检查对象是标准 kohya 数据集约定(`<repeats>_<concept>` 文件夹 + 同名 sidecar caption),sd-scripts / kohya_ss / OneTrainer 等训练器通用;脚本全程离线、不碰 GPU、不需要 trainer 在线。用户打算在**任何**训练器上练 LoRA,体检都照做。只有两处例外: - **WD14 打标**走 SD-Trainer 的 `POST /api/interrogate`——trainer 不在线/不存在时,改为建议用户用本地 tagger 打标,打完回来重检,不要因此跳过 caption 检查。 - **Anima `.json` caption 校验**只对已经持有 `.json` 标注的数据集有意义,且 `.json` 是否真被训练端读取**未经验证**(v2.7.0 本地代码中无读取实现)——一律建议以 `.txt` 为准;用户练 SD1.5/SDXL/Flux 或用别的训练器时,`json_structure` 问题可降级为忽略。 ## 触发与分支 有「训练前检查数据集 / caption / tag 质量」意图时触发:体检、检查数据集、看看标注、tag 有没有问题、能不能开训、trigger 一致吗、有没有重复图、步数够不够。 - 只是要**自动打标**(还没标注)→ 直接走打标(`POST /api/interrogate`,见 `../references/trainer-api.md`),打完再回来体检。 - 要**开始训练 / 调参** → 交给 `lora-trainer`;它会在开训前调用本 skill 作为闸门。 - 要查 caption 怎么写 / trigger 怎么取 → 读 `../refe