Closed donaldos closed 1 month ago
You'd better attach screenshot with your filesystem layout
In what folder do you have this
You don't have model.conf, it is required
Thank you for your advices. And I copy model.conf and another file to custom model set. And I get a good result. Thank you a lot.
Ok, good, let us know how it goes.
You want to apply a self-created model to VOSK. The structure of the model is am/final.mdl graph/HCLG.fst etc. However, looking at the original resource folder, it seems that the model is failing to load due to the presence of HCLr.fst Gr.fst in graph.
The model structure is as follows . |-- README |-- am | `-- final.mdl
|-- conf | |-- ivector_extractor.conf | |-- mfcc.conf | |-- online.conf | |-- online_cmvn.conf | `-- splice.conf
|-- graph | |-- HCLG.fst | |-- disambig_tid.int | |-- num_pdfs | |-- phones | | |-- align_lexicon.int | | |-- align_lexicon.txt | | |-- disambig.int | | |-- disambig.txt | | |-- optional_silence.csl | | |-- optional_silence.int | | |-- optional_silence.txt | | |-- silence.csl | | |-- word_boundary.int | |
-- word_boundary.txt | |-- phones.txt |
-- words.txt-- ivector |-- final.dubm |-- final.ie |-- final.mat |-- global_cmvn.stats |-- online_cmvn.conf
-- splice_optstest_simply.py modelpath = '/mnt/prj/workspace.speech/vosk.testbed/models.enuma'
model = Model(lang="en-us")
model = None try: model = Model(model_path=modelpath) except Exception as es: print(es)
When I run example/test_simply.py, I get the following error. ERROR (VoskAPI:Model():model.cc:122) Folder '/mnt/prj/workspace.speech/vosk.testbed/models.enuma' does not contain model files. Make sure you specified the model path properly in Model constructor. If you are not sure about relative path, use absolute path specification. Failed to create a model Traceback (most recent call last): File "/mnt/prj/workspace.speech/vosk.testbed/vosk-api/python/example/test_simple.py", line 31, in
rec = KaldiRecognizer(model, wf.getframerate())
File "/mnt/prj/workspace.speech/vosk.testbed/voskenv/lib/python3.10/site-packages/vosk/init.py", line 147, in init
self._handle = _c.vosk_recognizer_new(args[0]._handle, args[1])
AttributeError: 'NoneType' object has no attribute '_handle'
Exception ignored in: <function KaldiRecognizer.del at 0x7f9c6c4b51b0>
Traceback (most recent call last):
File "/mnt/prj/workspace.speech/vosk.testbed/voskenv/lib/python3.10/site-packages/vosk/init.py", line 161, in del
_c.vosk_recognizer_free(self._handle)
AttributeError: 'KaldiRecognizer' object has no attribute '_handle'
Any ideas and advice would be appreciated.