Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN

I’m trying to run wav2vec2 model on GPU and getting error.

DEVICE = ‘cuda’
wav2vec2_processor = Wav2Vec2Processor.from_pretrained(“facebook/wav2vec2-base-960h”)
wav2vec2_model = Wav2Vec2ForCTC.from_pretrained(“facebook/wav2vec2-base-960h”)
wav2vec2_model.to(DEVICE)

file_name = “myFile.wav”
speech, sr = librosa.load(file_name, sr=16000)
input_values = wav2vec2_processor(speech, sampling_rate=16000, return_tensors=“pt”).input_values
input_values.to(DEVICE)

logits = wav2vec2_model(input_values).logits

predicted_ids = torch.argmax(logits, dim=-1)
transcription = wav2vec2_processor.decode(predicted_ids[0])

And getting error:

RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the same or input should be a MKLDNN tensor and weight is a dense tensor

What am I missing ?