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 #1317

Closed
nalli-hu opened this issue Apr 5, 2023 · 3 comments

Comments

@nalli-hu
Copy link

nalli-hu commented Apr 5, 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.

@github-actions
Copy link

github-actions bot commented Apr 5, 2023

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@hbredin
Copy link
Member

hbredin commented Apr 6, 2023

To maximise the probability of someone answering your question:

  • if your issue is a bug report, please provide a minimum reproducible example, e.g. a link to a self-contained Google Colab notebook (i.e. containing everthing needed to reproduce the bug: installation of pyannote.audio, downloads of models or test data, etc...)

  • if your issue is a feature request, please read this first and update your request accordingly.

@stale
Copy link

stale bot commented Oct 3, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 3, 2023
@stale stale bot closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants