Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Can't find model (SpeechRecognition) #57

Open
kerbaypapilon opened this issue Jul 5, 2021 · 3 comments
Open

Can't find model (SpeechRecognition) #57

kerbaypapilon opened this issue Jul 5, 2021 · 3 comments

Comments

@kerbaypapilon
Copy link

Hello,
I am trying to run SpeechRecognition demo but, I get the error Fatal error: Can't find the model.
I followed the document created model both with torchaudio and my model but I get the same error.

Any solutions?

I use LibTorch 1.9.0

Thanks.

@jeffxtang
Copy link
Contributor

Sorry for the late reply. Did you drag and drop the created model to the Xcode project?

@ShaikhAfsan
Copy link

hello i have the same issue when i used my custom module any solution?

@bdytx5
Copy link

bdytx5 commented Nov 30, 2021

Is "Bundle.main.path(forResource: fileName, ofType: type)" failing or let module = InferenceModule(fileAtPath: filePath) failing?

I changed my code to this

private lazy var module: InferenceModule = {
    var fileName = "wav2vec2"
    var type = "ptl"
    if let filePath = Bundle.main.path(forResource: fileName, ofType: type){
        let module = InferenceModule(fileAtPath: filePath)
        return module!
    
    } else {
        fatalError("Can't find the model file!")
    }
}()   

and it still failed. Turned out I had exported the model on my own system using newer versions of pytorch and torchaudio.
Try downloading the model from the repo or exporting using the recommended versions of torch/torchaudio.

After doing this, it worked!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants