#297·piper

ValueError: n must be at least one

Author: ignacio82Created Dec 4, 2023Updated Aug 30, 2025

I'm trying to follow this tutorial and I'm getting an error when trying to do the reprocessing:

(.venv) ignacio@xps:~/piper/src/python$ python3 -m piper_train.preprocess --input-dir ~/test-ignacio/ --output-dir ~/out-train --language en-US --sample-rate 22050 --dataset-format ljspeech --single-speaker
INFO:preprocess:Single speaker dataset
INFO:preprocess:Wrote dataset config
INFO:preprocess:Processing 16 utterance(s) with 12 worker(s)
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/ignacio/piper/src/python/piper_train/preprocess.py", line 502, in <module>
    main()
  File "/home/ignacio/piper/src/python/piper_train/preprocess.py", line 225, in main
    for utt_batch in batched(
  File "/home/ignacio/piper/src/python/piper_train/preprocess.py", line 491, in batched
    raise ValueError("n must be at least one")
ValueError: n must be at least one

I'm running ubuntu in case it is relevant. Any ideas for what am I doing wrong and how to fix it?