Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while fine-tuning hyperparameters in the Pyannote.audio 2.1 Speaker Diarization Pipeline #47

Open
nalli-hu opened this issue Apr 4, 2023 · 0 comments

Comments

@nalli-hu
Copy link

nalli-hu commented Apr 4, 2023

I followed the notebook "Adapting pyannote.audio 2.1 pretrained speaker diarization pipeline to your own data" to adapt the Pyannote.audio 2.1 Speaker Diarization Pipeline to my own data.

I am using the pyannote.database structure to load my data, and the audio recordings are short snippets, with the shortest ones being one second in length.

However, when I try to fine-tune the hyperparameters using the following code:
iterations = optimizer.tune_iter(dev_set, show_progress=False)
best_loss = 1.0
for i, iteration in enumerate(iterations):
print(f"Best segmentation threshold so far: {iteration['params']['segmentation']['threshold']}")
if i > 20: break # 50 iterations should give slightly better results

I encounter the following error:
Traceback (most recent call last): File "/opt/miniconda3/envs/Asr2/lib/python3.9/site-packages/optuna/study/_optimize.py", line 200, in _run_trial value_or_values = func(trial) File "path/to/optimizer.py", line 210, in objective output = pipeline(input) File "/opt/miniconda3/envs/Asr2/lib/python3.9/site-packages/pyannote/audio/core/pipeline.py", line 238, in call return self.apply(file, **kwargs) File "/opt/miniconda3/envs/Asr2/lib/python3.9/site-packages/pyannote/audio/pipelines/speaker_diarization.py", line 494, in apply hardclusters, = self.clustering( File "/opt/miniconda3/envs/Asr2/lib/python3.9/site-packages/pyannote/audio/pipelines/clustering.py", line 612, in call oracle_segmentations = oracle_segmentation(file, window, frames=frames) File "/opt/miniconda3/envs/Asr2/lib/python3.9/site-packages/pyannote/audio/pipelines/utils/oracle.py", line 105, in oracle_segmentation return SlidingWindowFeature(np.float32(np.stack(segmentations)), window) File "<array_function internals>", line 180, in stack File "/opt/miniconda3/envs/Asr2/lib/python3.9/site-packages/numpy/core/shape_base.py", line 422, in stack raise ValueError('need at least one array to stack') ValueError: need at least one array to stack

Any suggestions on how to fix this error would be greatly appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant