Dadangdut33 / Speech-Translate

A realtime speech transcription and translation application using Whisper OpenAI and free translation API. Interface made using Tkinter. Code written fully in Python.
MIT License
436 stars 55 forks source link

[BUG]FileNotFoundError: [WinError 2] 系统找不到指定的文件。 #12

Closed lost9999 closed 1 year ago

lost9999 commented 1 year ago

2023-01-31 11:15:17,328 INFO - Booting up... (Main.py:959) [MainThread] 2023-01-31 11:15:17,328 DEBUG - Got console window (Main.py:962) [MainThread] 2023-01-31 11:15:19,949 INFO - Checking for update on start (About.py:108) [MainThread] 2023-01-31 11:15:20,074 INFO - Checking for update... (About.py:133) [MainThread] 2023-01-31 11:15:20,684 INFO - No update available (About.py:153) [Thread-3 (req_update_check)] 2023-01-31 11:15:40,683 INFO - Start Process (FILE) (Record.py:848) [Thread-4 (from_file)] 2023-01-31 11:15:41,853 INFO - -------------------------------------------------- (Record.py:761) [Thread-5 (multiproc_tc)] 2023-01-31 11:15:41,853 INFO - Transcribing Audio: D:/cicada3301/小说/艾斯13/nu/艾斯13.wav (Record.py:762) [Thread-5 (multiproc_tc)] 2023-01-31 11:15:41,853 DEBUG - Source Language: Auto (Record.py:771) [Thread-5 (multiproc_tc)] Exception in thread Thread-6 (run_threaded): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 776, in run_threaded File "whisper\transcribe.py", line 84, in transcribe File "whisper\audio.py", line 111, in log_mel_spectrogram File "whisper\audio.py", line 42, in load_audio File "ffmpeg_run.py", line 313, in run File "ffmpeg_run.py", line 284, in run_async File "subprocess.py", line 971, in init File "subprocess.py", line 1440, in _execute_child FileNotFoundError: [WinError 2] 系统找不到指定的文件。

mngarchow commented 1 year ago

I also got this bug when using the Import From File option of the 1.1.0 CPU release.

2023-01-30 19:44:23,830 DEBUG - Record Session Started (Record.py:362) [Thread-13 (rec_realTime)] Exception in thread Thread-11 (multiproc_tc): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 810, in multiproc_tc TypeError: byte indices must be integers or slices, not str 2023-01-30 19:44:24,472 INFO - Processing Audio (Record.py:398) [Thread-13 (rec_realTime)] 2023-01-30 19:44:24,474 DEBUG - File Write Time: 0.001009225845336914 (Record.py:410) [Thread-13 (rec_realTime)] 2023-01-30 19:44:24,474 INFO - Transcribing (Record.py:423) [Thread-13 (rec_realTime)] Exception in thread Thread-13 (rec_realTime): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 424, in rec_realTime File "whisper\transcribe.py", line 84, in transcribe File "whisper\audio.py", line 111, in log_mel_spectrogram File "whisper\audio.py", line 42, in load_audio File "ffmpeg_run.py", line 313, in run File "ffmpeg_run.py", line 284, in run_async File "subprocess.py", line 971, in init File "subprocess.py", line 1440, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified 2023-01-30 19:46:11,742 INFO - Recording PC Stopped (Main.py:877) [MainThread]

kpaax commented 1 year ago
  1. Confirming the same for Import From File and Record PC Sound.
  2. Record PC Mic works fine.
  3. Stopping Record PC Sound leaves GUI in temporary state with three bottom right buttons grayed out.

None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. 2023-01-31 12:14:40,931 INFO - Booting up... (Main.py:959) [MainThread] 2023-01-31 12:14:40,932 DEBUG - Got console window (Main.py:962) [MainThread] 2023-01-31 12:14:42,883 INFO - Checking for update on start (About.py:108) [MainThread] 2023-01-31 12:14:42,940 INFO - Checking for update... (About.py:133) [MainThread] 2023-01-31 12:14:43,281 INFO - No update available (About.py:153) [Thread-3 (req_update_check)] 2023-01-31 12:15:21,806 INFO - Start Process (FILE) (Record.py:848) [Thread-4 (from_file)] 2023-01-31 12:15:22,006 INFO - -------------------------------------------------- (Record.py:761) [Thread-5 (multiproc_tc)] 2023-01-31 12:15:22,006 INFO - Transcribing Audio: C:/Users/Romek/Desktop/BCandM.wav (Record.py:762) [Thread-5 (multiproc_tc)] 2023-01-31 12:15:22,007 DEBUG - Source Language: Auto (Record.py:771) [Thread-5 (multiproc_tc)] whisper\transcribe.py:78: UserWarning: FP16 is not supported on CPU; using FP32 instead Exception in thread Thread-6 (run_threaded): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 776, in run_threaded File "whisper\transcribe.py", line 84, in transcribe File "whisper\audio.py", line 111, in log_mel_spectrogram File "whisper\audio.py", line 42, in load_audio File "ffmpeg_run.py", line 313, in run File "ffmpeg_run.py", line 284, in run_async File "subprocess.py", line 971, in init File "subprocess.py", line 1440, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified 2023-01-31 12:15:27,605 INFO - Cancelling file import processing... (Main.py:937) [MainThread] 2023-01-31 12:15:27,667 INFO - End process (FILE) [Total time: 5.86s] (Record.py:906) [Thread-4 (from_file)] 2023-01-31 12:15:39,166 INFO - -------------------------------------------------- (Record.py:305) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,166 INFO - Task: transcribe (Record.py:306) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,167 INFO - Modelname: tiny (Record.py:307) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,168 INFO - Engine: Whisper (Record.py:308) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,168 INFO - Auto mode: True (Record.py:309) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,169 INFO - Source Lang: auto detect (Record.py:310) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,434 DEBUG - Sample Rate 44100 | channels 2 (Record.py:341) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,435 DEBUG - Device: (23) Głośniki (2- Focusrite Usb Audio) [Loopback] (Record.py:354) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,438 DEBUG - {'index': 23, 'structVersion': 2, 'name': 'Głośniki (2- Focusrite Usb Audio) [Loopback]', 'hostApi': 2, 'maxInputChannels': 2, 'maxOutputChannels': 0, 'defaultLowInputLatency': 0.003, 'defaultLowOutputLatency': 0.0, 'defaultHighInputLatency': 0.01, 'defaultHighOutputLatency': 0.0, 'defaultSampleRate': 44100.0, 'isLoopbackDevice': True} (Record.py:355) [Thread-7 (rec_realTime)] 2023-01-31 12:15:39,493 DEBUG - Record Session Started (Record.py:362) [Thread-7 (rec_realTime)] Exception in thread Thread-5 (multiproc_tc): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 810, in multiproc_tc TypeError: byte indices must be integers or slices, not str 2023-01-31 12:16:23,013 INFO - Processing Audio (Record.py:398) [Thread-7 (rec_realTime)] 2023-01-31 12:16:23,015 DEBUG - File Write Time: 0.0010709762573242188 (Record.py:410) [Thread-7 (rec_realTime)] 2023-01-31 12:16:23,015 INFO - Transcribing (Record.py:423) [Thread-7 (rec_realTime)] Exception in thread Thread-7 (rec_realTime): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 424, in rec_realTime File "whisper\transcribe.py", line 84, in transcribe File "whisper\audio.py", line 111, in log_mel_spectrogram File "whisper\audio.py", line 42, in load_audio File "ffmpeg_run.py", line 313, in run File "ffmpeg_run.py", line 284, in run_async File "subprocess.py", line 971, in init File "subprocess.py", line 1440, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified 2023-01-31 12:16:38,022 INFO - Recording PC Stopped (Main.py:877) [MainThread]

Capture

winterhub01 commented 1 year ago

I experience the same bug in transcribing video while using both the cpu and gpu versions.

None of PyTorch, TensorFlow >= 2.0, or Flax have been found. Models won't be available and only tokenizers, configuration and file/data utilities can be used. 2023-02-06 18:36:37,804 INFO - Booting up... (Main.py:959) [MainThread] 2023-02-06 18:36:37,805 DEBUG - Got console window (Main.py:962) [MainThread] 2023-02-06 18:36:39,393 INFO - Checking for update on start (About.py:108) [MainThread] 2023-02-06 18:36:39,494 INFO - Checking for update... (About.py:133) [MainThread] 2023-02-06 18:36:40,428 INFO - No update available (About.py:153) [Thread-3 (req_update_check)] 2023-02-06 18:36:54,547 INFO - Start Process (FILE) (Record.py:848) [Thread-4 (from_file)] 2023-02-06 18:36:55,304 INFO - -------------------------------------------------- (Record.py:761) [Thread-5 (multiproc_tc)] 2023-02-06 18:36:55,305 INFO - Transcribing Audio: C:/Users/Seyyid/Desktop/balaga.mp4 (Record.py:762) [Thread-5 (multiproc_tc)] 2023-02-06 18:36:55,305 DEBUG - Source Language: arabic (Record.py:771) [Thread-5 (multiproc_tc)] Exception in thread Thread-6 (run_threaded): Traceback (most recent call last): File "threading.py", line 1016, in _bootstrap_inner File "threading.py", line 953, in run File "speech_translate\utils\Record.py", line 776, in run_threaded File "whisper\transcribe.py", line 84, in transcribe File "whisper\audio.py", line 111, in log_mel_spectrogram File "whisper\audio.py", line 42, in load_audio File "ffmpeg_run.py", line 313, in run File "ffmpeg_run.py", line 284, in run_async File "subprocess.py", line 971, in init File "subprocess.py", line 1440, in _execute_child FileNotFoundError: [WinError 2] The system cannot find the file specified TC Wait (289.10s)

The count never stops, it just continues.

Username69992872 commented 1 year ago

Same error when trying to record with mic: FileNotFoundError: [WinError 2] Any fix? I dont even see which File it can not find :o

Dadangdut33 commented 1 year ago

interesting, i'll try to get this sorted asap

winterhub01 commented 1 year ago

Maybe this can help...

HOW TO FIX FileNotFoundError: [WinError 2] [https://www.youtube.com/watch?v=7EUmyB6wh1E]

Dadangdut33 commented 1 year ago

By any chance, do you guys not have ffmpeg installed?

winterhub01 commented 1 year ago

I'm using Subtitle Edit program on my Pc and it prompted me to install ffmpeg during installation, does that count?

Dadangdut33 commented 1 year ago

Does it add ffmpeg added to your path? if not you will need to add it. Because i sucesfully recreated this bug by uninstalling my ffmpeg from scoop.

Preview of the program with ffmpeg uninstalled and then after that I install it which fix the bug

I'll update the installation instruction. it's actually already located in readme but only on the development part.

Here are the instructions:

# on Ubuntu or Debian
sudo apt update && sudo apt install ffmpeg

# on Arch Linux
sudo pacman -S ffmpeg

# on MacOS using Homebrew (https://brew.sh/)
brew install ffmpeg

# on Windows using Chocolatey (https://chocolatey.org/)
choco install ffmpeg

# on Windows using Scoop (https://scoop.sh/)
scoop install ffmpeg

Verify if it is added to your path successfully or not by typing ffmpeg on your terminal

winterhub01 commented 1 year ago

Okay, thanks, would comment with update. Thanks a lot. {Update}: I installed ffmpeg via scoop on windows and it worked! Much appreciated.