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.57k stars 1.06k forks source link

Problem with torch module #1345

Open TPODAvia opened 1 year ago

TPODAvia commented 1 year ago

Hello, I cannot run a python program that includes vosk and torch modules. The program seems to stuck without any responding. I'm using Ubuntu 20.04.5 in Oracle VM. Screenshot 2023-04-27 055319

nshmyrev commented 1 year ago

Nice, an what happens if you press Ctrl+C?

TPODAvia commented 1 year ago

@nshmyrev Nothing. The only way is to use Ctrl+Z image

nshmyrev commented 1 year ago

ok an what are package versions? torch an vosk. Does torch load without vosk?

TPODAvia commented 1 year ago

I am using torch==2.0.0 and vosk==0.3.5 (The latest versions) To reproduce this issue, I wrote a simple python file that containing 3 lines of code: import vosk import torch print("hello")

Sometimes Ctrl+C worked, but take a very long time to execute. If we import the torch first and then the vosk, everything will be fine. Why this happened?

TPODAvia commented 1 year ago

@nshmyrev The work around of this Issue is to import torch before vosk. I hope this bug will fix in the next versions of vosk.

nshmyrev commented 1 year ago

Lets keep it open then