habla-liaa / ser-with-w2v2

Official implementation of INTERSPEECH 2021 paper 'Emotion Recognition from Speech Using Wav2vec 2.0 Embeddings'
126 stars 23 forks source link

Keyerror: '0' in w2v feature extraction #9

Open jiminbot20 opened 3 years ago

jiminbot20 commented 3 years ago

https://github.com/habla-liaa/ser-with-w2v2/blob/c9be8a9bc8c6c6969838e3e77c2fc8af10e27136/tasks/feature_extractors.py#L161

activation is dictionary. so it indexing this way does not work (activations[-1])

so I changed some into line below

features = list(activations.values())[-1].cpu().detach().numpy()

you might change indexing making into list or indexing name of the key