G
G
GLEK THE GREAT2021-07-22 22:11:18
Python
GLEK THE GREAT, 2021-07-22 22:11:18

How to solve error when using vosk library "Ivector feature dimension mismatch: got -1 but network expects 40"?

I did speech recognition using the vosk library, but it gives an error.

Here is part of the code:

import json
import pyaudio
from vosk import Model, KaldiRecognizer

p=pyaudio.PyAudio()
model = Model('vosk-model-small-ru-0.15')
rec = KaldiRecognizer(model, 8000)
streaming = p.open(format=pyaudio.paInt16, channels=1,rate = 8000, input=True, frames_per_buffer=8000)
streaming.start_stream()
engine = pyttsx3.init()


Here is the error:


ERROR (VoskAPI:DecodableNnetLoopedOnlineBase():decodable-online-looped.cc:50) Ivector feature dimension mismatch: got -1 but network expects 40
terminate called after throwing an instance of 'kaldi::KaldiFatalError'
what(): kaldi::KaldiFatalError


As I understand it, the problem is here:


Ivector feature dimension mismatch: got -1 but network expects 40


How to solve it? I have no idea

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nshmyrev, 2022-03-04
@nshmyrev

There is no ivector directory in the model, it should be there. The model may have been corrupted while downloading. Need to download again.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question