pyannote / pyannote-audio

Neural building blocks for speaker diarization: speech activity detection, speaker change detection, overlapped speech detection, speaker embedding
http://pyannote.github.io
MIT License
6.31k stars 780 forks source link

Model application issues #639

Closed bbrookie closed 3 years ago

bbrookie commented 3 years ago

I used another independent models to train embedding. Now I added the network to pyannote. The final file structure is set to be the same as the file structure obtained by pyannote training(The specific operation is that I directly copied all the files of emb_voxceleb in pyannote-audio-hub, just replaced my model file and changed the name of my model to {epoch}.pt, and modified the network parameters in the config.yml file )

but when I use --pretrained to specify the checkpoint path , Will raise an error: directory does not seem to be the path to a pretrained model checkpoint.

I tried to do this before, and the result is feasible (Although it will report the same error ,I didn’t make any special changes, it can be used after a while), but if a new model is added, the same error will still occur, this time I want to know how to solve this problem, so that I can directly use the network I trained separately

Looking forward to your reply , thank you

bbrookie commented 3 years ago

Sorry,Until now, this kind of problem will still appear after I add the model again. I don't have any solution. Can you help me answer it? the traceback like this: Traceback (most recent call last): File "/home/zhongcy/Public/pyannote-audio-master/notebooks/demo.py", line 28, in <module> method=method) File "/home/zhongcy/anaconda3/envs/audio/lib/python3.7/site-packages/pyannote/audio/pipeline/speaker_diarization.py", line 132, in __init__ embedding=self.embedding, metric=self.metric, method=self.method File "/home/zhongcy/anaconda3/envs/audio/lib/python3.7/site-packages/pyannote/audio/pipeline/speech_turn_clustering.py", line 78, in __init__ self._embedding = Wrapper(self.embedding) File "/home/zhongcy/anaconda3/envs/audio/lib/python3.7/site-packages/pyannote/audio/features/wrapper.py", line 217, in __init__ raise ValueError(msg) ValueError: "/home/zhongcy/Public/my_model/models/emb_resnet/train/X.SpeakerDiarization.VoxCeleb.train/weights/0326.pt" directory does not seem to be the path to a pretrained model checkpoint.

bbrookie commented 3 years ago

My model loading method is : `sad_score = "Public/my_model/models/sad/train/AMI.SpeakerDiarization.MixHeadset.train/weights/0095.pt" scd_score = "Public/my_model/models/scd/train/AMI.SpeakerDiarization.MixHeadset.train/weights/0149.pt" emb_score = "Public/my_model/models/emb_resnet/train/X.SpeakerDiarization.VoxCeleb.train/weights/0326.pt" method = "affinity_propagation"

pipeline = SpeakerDiarization(sad_scores={sad_score: {'step':0.1}}, scd_scores={scd_score: {'step':0.1}}, embedding={emb_score: {'step':0.1}}, #'duration':5} method=method)

params_yml = pathlib.Path('/Public/speake_diarization/my_model/pipline2_res/train/AMI.SpeakerDiarization.MixHeadset.development/params.yml') pipeline.load_params(params_yml)`