juanmc2005 / diart

A python package to build AI-powered real-time audio applications
https://diart.readthedocs.io
MIT License
903 stars 76 forks source link

TypeError: forward() got an unexpected keyword argument 'weights' #199

Closed SheenChi closed 8 months ago

SheenChi commented 8 months ago

I installed the diart according to readme.md, but when i run the command to test diart like:

diart.stream.exe --segmentation pretrained_model/pyannote/segmentation/pytorch_model.bin --embedding pretrained_model/pyannote/embedding/pytorch_model.bin data/test.wav

I have encountered the following problem: TypeError: forward() got an unexpected keyword argument 'weights'

How can i solve this problems, thanks

juanmc2005 commented 8 months ago

Hi @SheenChi, please verify what kind of model you get when you load your embedding model with:

from pyannote.audio import Model
embedding = Model.from_pretrained("pretrained_model/pyannote/embedding/pytorch_model.bin")

The class of embedding should be something like SincNetXVectorEmbedding, MFCCXVectorEmbedding or something like that from pyannote.audio. Otherwise your model and/or pyannote version might not be compatible.

SheenChi commented 8 months ago

Thanks for your answer, it's really helped me, i had mixed up the segmentation model and embedding model when i downloaded this from huggingface. and it can run normally now.