[Wav2Vec2] Cannot load newly added Wav2Vec2 checkpoints
See original GitHub issue🐛 Bug
A recent commit: https://github.com/pytorch/fairseq/commit/2513524a1604dbafcc4ea9cc5a99ae0aa4f19694 added two new fine-tuned Wav2Vec2 checkpoints, however it seems like there is a problem with the saved config as one cannot load those checkpoints. E.g. the following code cannot be run:
import fairseq
model, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task([checkpoint_path], arg_overrides={"data": "path/to/dict"})
To Reproduce
The following colab reproduces the error (one just has to run all cells): https://colab.research.google.com/drive/13hJI4w8pOD33hxOJ_qwKkN9QqdKVH5IM?usp=sharing
Kindly pinging @alexeib here 😃
Issue Analytics
- State:
- Created 2 years ago
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Issues saving and loading wav2vec2 models fine tuned using ...
After training some toy models, I realized that I couldn't load from the checkpoints or save and reload the model in the same...
Read more >Unable to load Wav2Vec2 fine-tuned models from local files
It produced a file speech_recognition_model.pt and a directory of checkpoints, as expected. However, I am unable to load either PT or checkpoint. For...
Read more >Speech to Text with Hugging face - Kaggle
Some weights of Wav2Vec2ForCTC were not initialized from the model checkpoint at facebook/wav2vec2-base-960h and are newly initialized: ...
Read more >Saving and Loading Models - PyTorch
When saving a general checkpoint, to be used for either inference or resuming training, you must save more than just the model's state_dict....
Read more >Build Speech Recognition for any Language with Transformers
This Video Tutorial explains step-by-step guide of the Colab Notebook Hugging Face Notebook has put together to Fine-Tune XLSR- Wav2Vec2 for ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@patrickvonplaten Hi, I met the same problem. Do you have any solution? Thank you. I run the code:
model, _, _ = fairseq.checkpoint_utils.load_model_ensemble_and_task([cp_path])
I got the error:
ConfigKeyError: Key 'target_dict' not in 'AudioPretrainingConfig' full_key: target_dict reference_type=Optional[AudioPretrainingConfig] object_type=AudioPretrainingConfig
same problem, Have you solved it?