ankitapasad / layerwise-analysis

Layer-wise analysis of self-supervised pre-trained speech representations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

wav2vec2.0 in extract_rep.py got ValueError: not enough values to unpack (expected 2, got 1)

swatsw opened this issue · comments

Running following after having completed steps 0-2:
model_name=wav2vec_base
dataset_split=dev-clean
data_sample=1
subset_id=0
rep_type=local
span=frame
save_dir_pth=./pth
. scripts/extract_rep.sh $model_name $ckpt_dir $data_sample $rep_type $span $subset_id $dataset_split $save_dir_pth $pckg_dir

Following error occurs:
layerwise-analysis/codes/prepare/model_utils.py", line 283, in fairseq_extractor
in_rep, local_features = self.encoder.feature_extractor(self.in_data)
ValueError: not enough values to unpack (expected 2, got 1)

I looked into self.encoder.feature_extractor() which is the forward function from fairseq
https://github.com/facebookresearch/fairseq/blob/7d050ada7d365b535bf7c634ed3bcaf1cc2930b1/fairseq/models/wav2vec/wav2vec2.py#L889

It only returns one output not two. Is this fairseq version issue?
I looked at several previous releases of fairseq and the same function still only has one output.

The model checkpoint I'm using is latest from fairseq wav2vec2.0 page (wav2vec_small.pt)

Missed last part of step 0.
After copying modellib_addons files over fairseq, this issue is solved.