alphacep / vosk-api

Offline speech recognition API for Android, iOS, Raspberry Pi and servers with Python, Java, C# and Node
Apache License 2.0
7.37k stars 1.04k forks source link

test_gpu_batch.py GET UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 4: invalid start byte #1502

Closed UniversalTechno closed 5 months ago

UniversalTechno commented 5 months ago

Hi PLease need help i followed the gpu install from source instruction and when launch test_ python3 test_gpu_batch.py test.wav I got

WARNING ([5.5.0~1-2b69]:SelectGpuId():cu-device.cc:243) Not in compute-exclusive mode. Suggestion: use 'nvidia-smi -c 3' to set compute exclusive mode LOG ([5.5.0~1-2b69]:SelectGpuIdAuto():cu-device.cc:438) Selecting from 1 GPUs LOG ([5.5.0~1-2b69]:SelectGpuIdAuto():cu-device.cc:453) cudaSetDevice(0): NVIDIA GeForce RTX 3060 Ti free:7813M, used:157M, total:7971M, free/total:0.980226 LOG ([5.5.0~1-2b69]:SelectGpuIdAuto():cu-device.cc:501) Device: 0, mem_ratio: 0.980226 LOG ([5.5.0~1-2b69]:SelectGpuId():cu-device.cc:382) Trying to select device: 0 LOG ([5.5.0~1-2b69]:SelectGpuIdAuto():cu-device.cc:511) Success selecting device 0 free mem ratio: 0.980226 LOG ([5.5.0~1-2b69]:FinalizeActiveGpu():cu-device.cc:338) The active GPU is [0]: NVIDIA GeForce RTX 3060 Ti free:7301M, used:669M, total:7971M, free/total:0.915994 version 8.6 LOG ([5.5.0~1-2b69]:RemoveOrphanNodes():nnet-nnet.cc:948) Removed 0 orphan nodes. LOG ([5.5.0~1-2b69]:RemoveOrphanComponents():nnet-nnet.cc:847) Removing 0 orphan components. LOG ([5.5.0~1-2b69]:BatchModel():batch_model.cc:52) Loading HCLG from /opt/vosk-api/python/example/vosk-model-en-us-0.22/graph/HCLG.fst LOG ([5.5.0~1-2b69]:BatchModel():batch_model.cc:56) Loading words from /opt/vosk-api/python/example/vosk-model-en-us-0.22/graph/words.txt LOG ([5.5.0~1-2b69]:BatchModel():batch_model.cc:64) Loading winfo /opt/vosk-api/python/example/vosk-model-en-us-0.22/graph/phones/word_boundary.int LOG ([5.5.0~1-2b69]:ComputeDerivedVars():ivector-extractor.cc:183) Computing derived variables for iVector extractor LOG ([5.5.0~1-2b69]:ComputeDerivedVars():ivector-extractor.cc:204) Done. Traceback (most recent call last): File "/opt/vosk-api/python/example/test_gpu_batch.py", line 16, in fnames = fn.readlines() File "/opt/conda/lib/python3.10/codecs.py", line 322, in decode (result, consumed) = self._buffer_decode(data, self.errors, final) UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 4: invalid start byte LOG ([5.5.0~1-2b69]:~CachingOptimizingCompiler():nnet-optimize.cc:710) 0.052 seconds taken in nnet3 compilation total (breakdown: 0.032 compilation, 0.00264 optimization, 0.0154 shortcut expansion, 0.000483 checking, 8.49e-05 computing indexes, 0.00137 misc.) + 0 I/O.

nshmyrev commented 5 months ago

Feels like test.list has some non-utf characters. You can probably use latin letters for teh files as a quick fix.

UniversalTechno commented 5 months ago

THANKS A lot but please give me a hint where to modify at source code test_gpu_batch.py or at systeme level or sould i convert audio file format please your help ist very important as im making a benshmark for vosk in gpu hardware thanks a lot

nshmyrev commented 5 months ago

You submit test.wav as an argument I see now, it should be a file with a list of small chunks instead. Or a list of test files. Read the example code please.

UniversalTechno commented 5 months ago

Ourraaa !!!!! i found it me too but it was late i just realised that you are summiting a list of wav files inside a file list any way many and have a great day