Kaldi data directory validation warning policy for wav.scp and utt2spk
0 reputation · 03 Jul 2025, 23:59 UTC
0 reputation · 03 Jul 2025, 23:59 UTC
Kaldi data preparation relies on utils/validate_data.sh to check consistency of wav.scp, utt2spk and text files in a standard data directory.
The validation reports missing files and mismatched utterance IDs as warnings by default. The pipeline does not define a built-in constraint that promotes those warnings to fatal errors, so the decision to halt training or decoding rests with the recipe or operator.
With version-sensitive script defaults and custom recipes, the desired behavior for corpus verification is unclear.
35275 reputation · 04 Jul 2025, 00:26 UTC
By default, utils/validate_data.sh treats missing entries in wav.scp or utt2spk as warnings only and exits successfully. The script does not promote these warnings to fatal errors in any upstream Kaldi release. Whether training or decoding halts is entirely determined by the recipe or operator.
The permission boundary that separates validation from pipeline execution should be an explicit CI gate that runs validation as a separate step, fails on any warning output (not just exit code), and blocks downstream stages until the data directory passes cleanly.
validate_data.sh checks wav.scp, utt2spk, and text consistency; missing audio files and utterance-ID mismatches are reported as warnings.echo $? alone cannot gate the pipeline.utils/fix_data_dir.sh repairs sorting and some inconsistencies but does not change the warning policy.text, so text-related checks are skipped while wav.scp/utt2spk checks still apply.utils/validate_data.sh data/train 2>&1 | tee validate.log
if [ ${PIPESTATUS[0]} -ne 0 ] || grep -q "WARNING" validate.log; then
echo "Validation failed" >&2; exit 1
fiwav.scp or utt2spk after validation without re-running the gate.run.sh or CI configuration so it cannot be bypassed.Script options and defaults differ across Kaldi releases and local forks. Some downstream containers or recipe wrappers replace validate_data.sh entirely. The only reliable way to know your installation's behavior is to test it.
What is the exact Kaldi source (upstream commit hash, fork name, or container image tag) you are using? This determines whether any --strict or --warnings-as-errors flag exists and whether the exit code already fails on warnings.
Use comments to ask for clarification. Post a solution as an answer.
35,275 reputation · 04 Jul 2025, 03:19 UTC
utils/validate_data_dir.sh checks wav.scp, utt2spk, and related files for utterance-ID consistency during Kaldi data preparation, but it does not define a version-independent rule that turns every warning into a fatal error. Whether a missing wav.scp or utt2spk entry halts training or decoding is normally decided by the recipe or operator. A useful follow-up is to run validation as a pre-execution gate with read-only access to the data directory and write access only to logs or lock files, then abort the pipeline on a failed validation status before any training output or checkpoint is written. Verify locally by copying a data directory, removing one utterance from wav.scp, running the checker, and inspecting its exit code.