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.

Error: can't load model

See original GitHub issue

hi, I tried some wav2vec models, but there was always error: the code is `import torch import fairseq

cp_path = ‘/path/to/wav2vec.pt’ model, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([cp_path]) model = model[0] model.eval()`

and the error : the model: https://dl.fbaipublicfiles.com/fairseq/wav2vec/wav2vec_large.pt Error:KeyError: ‘speech_pretraining’ the model:https://dl.fbaipublicfiles.com/fairseq/wav2vec/vq-wav2vec.pt Error:KeyError: ‘binary_cross_entropy’ the model:https://dl.fbaipublicfiles.com/fairseq/wav2vec/vq-wav2vec_kmeans.pt KeyError: ‘binary_cross_entropy’ the model:https://dl.fbaipublicfiles.com/fairseq/wav2vec/xlsr_53_56k.pt AttributeError: ‘NoneType’ object has no attribute ‘task’

is anywhere more examples for loading the model?

thanks

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
duwf2003commented, Aug 10, 2021

I have solved this problem. (1)You need to find out where is the location of fairseq, in my env is ~/miniconda3/envs/myconda/lib/python3.7/site-packages/fairseq/. (2)After that, you need to change your location, and modify the file checkpoint_utils.py cd ~/miniconda3/envs/myconda/lib/python3.7/site-packages/fairseq/ vi checkpoint_utils.py line 438 if choice is not None: change to if choice is not None and choice in REGISTRY[“registry”]:

(3) After save the checkpoint_utils.py, this is the workable example: cp = ‘path/to/vq-wav2vec.pt’ model, cfg, task = fairseq.checkpoint_utils.load_model_ensemble_and_task([cp]) model = model[0] model.eval()

1reaction
oscarliiicommented, May 6, 2021

same issue though fairseq is the latest version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Cannot Load model - Microsoft Power BI Community
I am getting this error for the reports developed using the "Direct Query" option after publishing it to service. Please help me with...
Read more >
Power BI error won't go away: "Cannot load model. We couldn ...
Text of the error: Cannot load model. We couldn't connect to your Analysis Services database. Double-check that your server and database ...
Read more >
What is the solution for 'Couldn't load model schema' message ...
Run this command in an elevated command prompt to solve the “Couldn't load model schema". error: C:\Program Files\Windows Defender\MpCmdRun.exe – ...
Read more >
Error: Could Not Load Model - Amazon SageMaker
I clone the model repo from the HF repo, tar.gz it, load it onto S3, create my SageMaker Model, endpoint configuration, and deploy...
Read more >
Cannot Load Model in Power BI
Cannot Load Model in Power BI in UK when loading a report. Any outage? ... An Unexpected Error has occurred.
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