Describe the bug
The model training/export process fails when custom classifier labels contain multiple underscores.
Our custom label system appends vocalization types to a base label using underscores. However, BirdNET appears to split the label on _ and expects exactly two parts. When a label contains more than one underscore, the export fails with:
ValueError: Columns must be same length as key
The error appears to occur in birdnet_analyzer/analyze/core.py, for example at:
df[["Scientific name", "Common name"]] = df["species_name"].str.split(
"_", expand=True
)
This split creates more than two columns when the label contains multiple underscores.
Example labels that trigger the issue:
Pipile pipile_Trinidad Piping-Guan_v=full song 1
Pipile pipile_Trinidad Piping-Guan_v=instrumental
These labels contain more than one underscore, so splitting on _ returns more than two parts and causes the assignment to fail.
Expected behavior
Custom classifier labels with multiple underscores should not cause the export or training process to fail.
BirdNET should either:
- split only on the first underscore, or
- support labels containing multiple underscores, or
- validate the label format earlier and provide a clear error message explaining the allowed format.
Screenshots
Desktop (please complete the following information):
Additional context
This breaks for custom labels that use additional underscores to encode vocalization types or other metadata.
If multiple underscores are not acceptable please clarify custom label format.
Describe the bug
The model training/export process fails when custom classifier labels contain multiple underscores.
Our custom label system appends vocalization types to a base label using underscores. However, BirdNET appears to split the label on
_and expects exactly two parts. When a label contains more than one underscore, the export fails with:The error appears to occur in
birdnet_analyzer/analyze/core.py, for example at:This split creates more than two columns when the label contains multiple underscores.
Example labels that trigger the issue:
These labels contain more than one underscore, so splitting on
_returns more than two parts and causes the assignment to fail.Expected behavior
Custom classifier labels with multiple underscores should not cause the export or training process to fail.
BirdNET should either:
Screenshots
Desktop (please complete the following information):
Additional context
This breaks for custom labels that use additional underscores to encode vocalization types or other metadata.
If multiple underscores are not acceptable please clarify custom label format.