speechbrain icon indicating copy to clipboard operation
speechbrain copied to clipboard

[Speech separation] Train model inference Error

Open heunggyulee opened this issue 3 years ago • 2 comments

Hello. First of all, Thank you for sharing nice code :)

I trained Speech separation model(aishell1mix2) 13 times epoch and got save folder "results/sepformer-aishell1mix2/1234/save/CKPT+2022-08-01+07-18-54+00/"

i want to use save model to inference with my mix audio file. so i used below code and i got an keyerror 'pretraine'

**from speechbrain.pretrained import SepformerSeparation as separator import torchaudio

model = separator.from_hparams(source="results/sepformer-aishell1mix2/1234/save/CKPT+2022-08-01+07-18-54+00/", savedir="temp")

File ~/anaconda3/envs/speechbrain/lib/python3.8/site-packages/speechbrain/pretrained/interfaces.py:362, in Pretrained.from_hparams(cls, source, hparams_file, pymodule_file, overrides, savedir, use_auth_token, **kwargs) 359 hparams = load_hyperpyyaml(fin, overrides) 361 # Pretraining: --> 362 pretrainer = hparams["pretrainer"] 363 pretrainer.set_collect_in(savedir) 364 # For distributed setups, have this here:

KeyError: 'pretrainer'**

Is there any mistake?

heunggyulee avatar Aug 01 '22 03:08 heunggyulee

Hi, I encourage you to first read properly the tutorial we provide on our website for inference. It is most likely that you did not create the pretrainer in your YAML :-) Inference is something very particular as it may change depending on the needs (e.g. stability for production, flexibility for research etc). Hence, SpeechBrain provides multiple ways of doing it, all are describe on the tutorial.

TParcollet avatar Aug 10 '22 08:08 TParcollet

Hello @heunggyulee,

Is there any news about this issue?

Adel-Moumen avatar Sep 08 '22 19:09 Adel-Moumen

Hello,

There has been no activity for a very long time. Therefore, I am closing this issue.

Feel free to reopen if needed. Thanks! :)

Adel-Moumen avatar Sep 26 '22 18:09 Adel-Moumen