fairseq: [Wav2Vec2] Cannot load newly added Wav2Vec2 checkpoints
π 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 π
About this issue
- Original URL
- State: open
- Created 3 years ago
- Comments: 15 (4 by maintainers)
@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?
You can solve this by cloning the repo, and then just copying all those missing parameters from the audio fine-tuning config into the audio pretraining config
We have the robust models otherwise also on the HF Hub: https://huggingface.co/models?arxiv=arxiv:2104.01027 if youβre interested
@patrickvonplaten a notebook with a working example also, I removed
https://colab.research.google.com/drive/1gPQ1LzAoEbQtRYRGVPz4zg9Klo-ErwjH?usp=sharing
Still got the same problem π
See https://colab.research.google.com/drive/13hJI4w8pOD33hxOJ_qwKkN9QqdKVH5IM?usp=sharing