ValueError and file path issues when running BirdNET Analyzer with --use_perch True (Windows, Python 3.9, Perch v2 model)
I am able to run BirdNET Analyzer successfully in the standard (BirdNET) mode, but when enabling the Perch model using --use_perch True, the analysis fails with a series of errors related to model label length mismatch and missing paths.
Environment
- OS: Windows 10
- Python: 3.9 (conda environment: birdnet)
- BirdNET-Analyzer version: latest from GitHub (cloned October 2025)
- Command used:
python -m birdnet_analyzer.analyze ^ --i "D:\xxxxxx" ^ --o "D:\xxxxxxx" ^ --lat 24.29 --lon 87.25 --week 30 ^ --min_conf 0.1 ^ --use_perch True
Observed behavior
The script begins downloading the Perch model via kagglehub successfully and finds the model: Model found!
Then it fails with the following traceback:ValueError: zip() argument 2 is longer than argument 1 File "birdnet_analyzer/model.py", line 1021, in explore l_filter = list(zip(l_filter, cfg.LABELS, strict=True))
In some runs, it also throws:
FileNotFoundError: [Errno 2] No such file or directory: 'perch\\assets\\label.csv'
or
Error: Cannot analyze audio file ...
Expected behavior
The Perch model should analyze the input WAV files in the same way as the standard BirdNET model, producing .BirdNET.results CSVs and allowing --use_perch True to act as a direct model switch.
What works
Running without --use_perch (default BirdNET model) works perfectly:
Troubleshooting attempted
Confirmed both .labels.csv and ._labels.csv exist under
- C:\Users<User>.cache\kagglehub\models\google\bird-vocalization-classifier\tensorFlow2\perch_v2_cpu\1\assets\
- Tried adjusting LABELS_FILE paths and re-running — same error.
- Verified audio sample rates (32 kHz, 44.1 kHz) — same issue.
- Also confirmed Perch model loads (≈388 MB) before crashing.
Request
Could you please clarify:
- Whether --use_perch True requires a specific configuration format or a separate label file structure,
- If the label alignment mismatch (zip() argument 2 is longer than argument 1) indicates a known issue between BirdNET-Analyzer and the Perch v2 model,
- Or if any modification is needed in cfg.LABELS_FILE or species/utils.py to ensure compatibility?
- Or any other solution?
I'm a little confused by your CLI call, because the parameters used are long deprecated, but --use_perch is a current addition. Are you using a fork? Are you using the current repo?