question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to perform inference on self trained model?

See original GitHub issue

Hi There,

Thanks for this great tutorial, I have trained the ASR model, with the colab notebook, ASRfromScratch. I get the following files in the folder (named: CKPT+2021-09-28+05-51-12+00): brain.ckpt CKPT.yaml counter.ckpt dataloader-Train.ckpt model.ckpt normalizer.ckpt optimizer.ckpt scheduler.ckpt

from speechbrain.pretrained import EncoderDecoderASR
asr_model = EncoderDecoderASR.from_hparams(source="speechbrain/asr-crdnn-rnnlm-librispeech", savedir="pretrained_model")
audio_file = 'speechbrain/asr-crdnn-rnnlm-librispeech/example.wav'
asr_model.transcribe_file(audio_file)

Here I tried to change source to CKPT+2021-09-28+05-51-12+00

from speechbrain.pretrained import EncoderDecoderASR
asr_model = EncoderDecoderASR.from_hparams(source="CKPT+2021-09-28+05-51-12+00")
audio_file = 'speechbrain/asr-crdnn-rnnlm-librispeech/example.wav'
asr_model.transcribe_file(audio_file)

I get the error: FileNotFoundError: [Errno 2] No such file or directory: ‘pretrained_models/EncoderDecoderASR–8767517085281277641/hyperparams.yaml’

when I copied hyperparams.yaml from existing model to this folder.
OSError: [Errno 95] Operation not supported: ‘/content/drive/MyDrive/speechbrain/speechbrain/templates/speech_recognition/ASR/results/CRDNN_BPE_960h_LM/2602/save/CKPT+2021-09-28+05-51-12+00/normalizer.ckpt’ -> 'pretrained_models/EncoderDecoderASR–8767517085281277641/normalizer.ckpt

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18

github_iconTop GitHub Comments

1reaction
TParcolletcommented, Sep 30, 2021
from speechbrain.pretrained import EncoderDecoderASR
asr_model = EncoderDecoderASR.from_hparams(source="/users/myuser/full/path/speechbrain/asr-crdnn-rnnlm-librispeech", savedir="results")

source must be the directory containing all the loadable, save_dir is where you want to store the results / links to the models of the source.

1reaction
TParcolletcommented, Sep 30, 2021

it means that this path cannot be identified as a path. I never ran that on Colab, but you have to check if there is anything specific about it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial: Inference with a pre-trained model. - AllenAct
In this tutorial we will run inference on a pre-trained model for the PointNav task in the RoboTHOR environment. In this task the...
Read more >
Inferencing the Transformer Model - Machine Learning Mastery
In this tutorial, you will discover how to run inference on the trained Transformer model for neural machine translation. After completing this ...
Read more >
Deep Learning basics with Python, TensorFlow and Keras p.6
Your browser can't play this video. ... How to use your trained model - Deep Learning basics with Python, TensorFlow and Keras p.6....
Read more >
Inference and Validation - Ryan Wingate
Inference, a term borrowed from statistics, is the process of using a trained model to make making predictions.
Read more >
TensorFlow Lite inference
The term inference refers to the process of executing a TensorFlow Lite model on-device in order to make predictions based on input data....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found