#6294·espnet

Batch type bug

Author: fsepteixeiraCreated Nov 10, 2025Updated Jul 10, 2026
LabelsBugSID

When running the default recipe for VoxCeleb, with conf/train_ECAPA_wavlm_joint.yaml, I get the following error at the start of the 2nd epoch:

2025-11-07 03:42:09,503 (trainer:324) INFO: 2/20epoch started. Estimated time to finish: 1 day, 13 hours and 30 minutes
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "espnet/espnet2/bin/spk_train.py", line 27, in
main()
File "espnet/espnet2/bin/spk_train.py", line 23, in main
SpeakerTask.main(cmd=cmd)
File "espnet/espnet2/tasks/abs_task.py", line 1281, in main
cls.main_worker(args)
File "espnet/espnet2/tasks/abs_task.py", line 1638, in main_worker
cls.trainer.run(
File "espnet/espnet2/train/trainer.py", line 347, in run
iterator=train_iter_factory.build_iter(iepoch),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "espnet/espnet2/iterators/category_iter_factory.py", line 115, in build_iter
raise ValueError(f"Unsupported batch_type: {self.batch_type}")
ValueError: Unsupported batch_type: folded

After checking the batch types in category_iter_factory.py, I tried to put as an argument in the conf file batch_type: catbel

Which raised the following error: 2025-11-10 11:35:16,170 (abs_task:2051) INFO: [train] mini-batch sizes summary: N-batch=116177, mean=32.0, min=32, max=32 Traceback (most recent call last): File "", line 198, in _run_module_as_main File "", line 88, in _run_code File "espnet/espnet2/bin/spk_train.py", line 27, in main() File "espnet/espnet2/bin/spk_train.py", line 23, in main SpeakerTask.main(cmd=cmd) File "espnet/espnet2/tasks/abs_task.py", line 1281, in main cls.main_worker(args) File "espnet/espnet2/tasks/abs_task.py", line 1561, in main_worker valid_iter_factory = cls.build_iter_factory( ^^^^^^^^^^^^^^^^^^^^^^^ File "espnet/espnet2/tasks/abs_task.py", line 1788, in build_iter_factory return cls.build_sequence_iter_factory( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "espnet/espnet2/tasks/abs_task.py", line 1862, in build_sequence_iter_factory batch_sampler = build_batch_sampler( ^^^^^^^^^^^^^^^^^^^^ File "espnet/espnet2/samplers/build_batch_sampler.py", line 216, in build_batch_sampler raise ValueError( ValueError: Not supported: catbel. Please specify batch_type in unsorted, sorted, folded, numel, length.

I suspect there is a mismatch between the batch types defined in build_batch_sampler.py and category_iter_factory.py. As a quick fix I reverted back to the previous version of category_iter_factory.py, which used the CategoryBalancedSampler by default.