convert_wav2vec2_original_pytorch_checkpoint_to_pytorch.py
does not work due to weight norm key
#31633
Closed
1 of 4 tasks
Labels
System Info
NA
Who can help?
@sanchit-gandhi
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
Fairseq uses
nn.utils.weight_norm()
, which producesweight_g
andweight_v
keyshttps://github.com/facebookresearch/fairseq/blob/d9a627082fd03ec72a27a31a4e56289bfcb2e4e4/fairseq/models/wav2vec/wav2vec2.py#L939
The weight conversion script assumes this old-style weight norm
transformers/src/transformers/models/wav2vec2/convert_wav2vec2_original_pytorch_checkpoint_to_pytorch.py
Lines 118 to 121 in 2daf2c3
Thus, the weight conversion script will fail since
transformers
has switched tonn.utils.parametrizations.weight_norm
for quite some time, which producesparametrizations.weight.original0
andparametrizations.weight.original1
keys instead.transformers/src/transformers/models/wav2vec2/modeling_wav2vec2.py
Lines 392 to 394 in 1218e43
Thus the weight conversion script should be updated accordingly.
Expected behavior
Weight conversion script works.
The text was updated successfully, but these errors were encountered: