# AttributeError: 'Wav2Vec2FeatureExtractor' object has no attribute 'decode'

**URL:** <https://discuss.huggingface.co/t/attributeerror-wav2vec2featureextractor-object-has-no-attribute-decode/32412>\
**Category:** Models\
**Created:** [February 24, 2023, 6:01am UTC](https://discuss.huggingface.co/t/attributeerror-wav2vec2featureextractor-object-has-no-attribute-decode/32412 "2023-02-24T06:01:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![laro1](https://avatars.discourse-cdn.com/v4/letter/l/ad7895/32.png) [@laro1](https://discuss.huggingface.co/u/laro1)\
**Post date:** [February 24, 2023, 6:01am UTC](https://discuss.huggingface.co/t/attributeerror-wav2vec2featureextractor-object-has-no-attribute-decode/32412/1 "2023-02-24T06:01:24Z")

</div>

I’m trying to run simple example of wav2vec2 and getting error:

```
import torch
from transformers import Wav2Vec2ForCTC, Wav2Vec2FeatureExtractor
import librosa

model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-large-xlsr-53")

feature_extractor = Wav2Vec2FeatureExtractor.from_pretrained("facebook/wav2vec2-large-xlsr-53")

SPEECH_FILE = "/home/heb.wav"

waveform, sample_rate = librosa.load(SPEECH_FILE, sr=16000)

features = feature_extractor(waveform, sampling_rate=sample_rate, return_tensors="pt")

with torch.no_grad():
    logits = model(features.input_values).logits

# Decode the predicted transcription from the logits
predicted_ids = torch.argmax(logits, dim=-1)
transcription = feature_extractor.decode(predicted_ids[0])

print(transcription)

```

I’m getting error:

```
AttributeError: 'Wav2Vec2FeatureExtractor' object has no attribute 'decode'

```

How can I decode the wav2vec2 output ?

(I’m using transformers version: 4.11.3)
