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

Fix missing .cpu() call causing WeSpeaker embedding pipeline to crash #1518

Closed
wants to merge 2 commits into from

Conversation

juanmc2005
Copy link
Collaborator

Problem

When waveform and masks are both on GPU, the WeSpeaker pipeline crashes because it can't convert features to numpy without moving the tensor to CPU first.

Also mentioned here: juanmc2005/diart#188

Minimal Reproducible Example

import torch
from pyannote.audio.pipelines.speaker_verification import PretrainedSpeakerEmbedding

model = PretrainedSpeakerEmbedding("hbredin/wespeaker-voxceleb-resnet34-LM")
model.to(torch.device("cuda"))

waveform = torch.randn(4, 1, 80000).cuda()
weights = torch.rand(4, 300).cuda()

emb = model(waveform, weights)

print(emb.shape)

@juanmc2005
Copy link
Collaborator Author

This is also solved by #1529
@hbredin closing this one to avoid duplicates

@juanmc2005 juanmc2005 closed this Nov 5, 2023
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

Successfully merging this pull request may close these issues.

None yet

1 participant