glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
verdooft schrieb: Ich hab jetzt 2 mal geschrieben, dass BENUTZER durch den tatsächlichen Linuxuser ersetzt werden muss. Meine Anleitung verwendet jetzt aber ~, was /home/BENUTZER entspricht. Bei meiner VM: echo ~
/home/linux
OK, sorry. Hab ich nicht gesehen. Aber mein /home/user/whisper/.venv Verzeichnis ist leer.
|
verdooft
Anmeldungsdatum: 15. September 2012
Beiträge: 4286
|
Ich hab die Schritte gerade in einer VM durchgeführt, nachdem ich
pip install -U openai-whisper
in der virtuellen Pythonumgebung ausgeführt hatte, sieht es dort so aus: ls -al ~/whisper/.venv/
insgesamt 28
drwxrwxr-x 6 linux linux 4096 Jan 4 18:35 .
drwxrwxr-x 3 linux linux 4096 Jan 4 18:21 ..
drwxrwxr-x 2 linux linux 4096 Jan 4 18:36 bin
drwxrwxr-x 2 linux linux 4096 Jan 4 18:26 include
drwxrwxr-x 3 linux linux 4096 Jan 4 18:26 lib
lrwxrwxrwx 1 linux linux 3 Jan 4 18:26 lib64 -> lib
-rw-rw-r-- 1 linux linux 71 Jan 4 18:26 pyvenv.cfg
drwxrwxr-x 3 linux linux 4096 Jan 4 18:35 share
Da in bin liegt auch die ausführbare Datei whisper, die gefunden wird, wenn man sich in der virtuellen Pythonumgebung befindet. Wenn pip im venv nicht geht, wirst du "This environment is externally managed" abstellen müssen, dazu habe ich was verlinkt.
|
glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
verdooft schrieb: Ok, da du pip und python3-venv eh schon installiert hast, kannst du damit weitermachen: Erstellen der virtuelllen Pythonumgebung Ansonsten hat einer das geschrieben: I've got this error since Python 3.11+ and I've passed this error using this:
sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED
https://stackoverflow.com/questions/75608323/how-do-i-solve-error-externally-managed-environment-every-time-i-use-pip-3 Ich verwende Python 3.10, da kam die Meldung noch nicht.
Das sagt meine Konsole dazu: soma@compi:~$ cd /home/soma/
soma@compi:~$ mkdir -p -v ~/whisper/.venv
mkdir: Verzeichnis '/home/soma/whisper' angelegt
mkdir: Verzeichnis '/home/soma/whisper/.venv' angelegt
soma@compi:~$ cd Downloads
soma@compi:~/Downloads$ wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
--2024-01-04 19:28:35-- https://bootstrap.pypa.io/get-pip.py
Auflösen des Hostnamens bootstrap.pypa.io (bootstrap.pypa.io) … 199.232.188.175, 2a04:4e42:8d::175
Verbindungsaufbau zu bootstrap.pypa.io (bootstrap.pypa.io)|199.232.188.175|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 2634817 (2,5M) [text/x-python]
Wird in ‘get-pip.py.4’ gespeichert.
get-pip.py.4 100%[===================>] 2,51M 8,07MB/s in 0,3s
2024-01-04 19:28:36 (8,07 MB/s) - ‘get-pip.py.4’ gespeichert [2634817/2634817]
[sudo] Passwort für soma:
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.
If you wish to install a non-Debian packaged Python application,
it may be easiest to use pipx install xyz, which will manage a
virtual environment for you. Make sure you have pipx installed.
See /usr/share/doc/python3.11/README.venv for more information.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
soma@compi:~/Downloads$ sudo rm /usr/lib/python3.11/EXTERNALLY-MANAGED
soma@compi:~/Downloads$ wget https://bootstrap.pypa.io/get-pip.py
sudo python3 get-pip.py
--2024-01-04 19:32:03-- https://bootstrap.pypa.io/get-pip.py
Auflösen des Hostnamens bootstrap.pypa.io (bootstrap.pypa.io) … 146.75.116.175, 2a04:4e42:8d::175
Verbindungsaufbau zu bootstrap.pypa.io (bootstrap.pypa.io)|146.75.116.175|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 200 OK
Länge: 2634817 (2,5M) [text/x-python]
Wird in ‘get-pip.py.5’ gespeichert.
get-pip.py.5 100%[===================>] 2,51M 8,07MB/s in 0,3s
2024-01-04 19:32:03 (8,07 MB/s) - ‘get-pip.py.5’ gespeichert [2634817/2634817]
Collecting pip
Downloading pip-23.3.2-py3-none-any.whl.metadata (3.5 kB)
Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 8.3 MB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.2
ERROR: Cannot uninstall pip 23.2, RECORD file not found. Hint: The package was installed by debian.
soma@compi:~/Downloads$
|
verdooft
Anmeldungsdatum: 15. September 2012
Beiträge: 4286
|
Ja, du kannst auch das pip von Ubuntu verwenden, einfach den Teil überspringen. python3-venv ist schon installiert, also kannst du das venv direkt erstellen und aktivieren jetzt. Im venv scheint pip zu funktionieren, die Installation von whisper ist vorhin an "Keine Berechtigung" gescheitert, das müsste mit dem neuen Ordner jetzt funktionieren.
|
glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
Jetzt wurde tatsächlich alles installiert. Auch die hilfe Datei kam. Aber wenn ich die srt des Videos extrahieren möchte, sagt die Konsole das hier: format srt
Der Befehl 'whisper' wurde nicht gefunden, meinten Sie:
Befehl 'whipper' aus dem deb whipper (0.10.0-2build2)
Versuche: sudo apt install <deb name>
|
verdooft
Anmeldungsdatum: 15. September 2012
Beiträge: 4286
|
Du bist im aktiven venv? (.venv) linux@vmt1:~/whisper$ which whisper
/home/linux/whisper/.venv/bin/whisper Das musst du bei jeder Verwendung, also auch, wenn du ein neues Terminal öffnest, erst aktivieren, z.B. mit: source ~/whisper/.venv/bin/activate Übrigens war das am Ende der Anleitung keine Hilfedatei, da wurde whisper mit der Option --help aufgerufen.
|
glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
Du wirst es nicht glauben, aber das Ding läuft gerade. 😀 Ich wusste das nicht dass man das jedesmal aktivieren muss. Vielen Dank für deine unendliche Geduld. Ist manchmal etwas schwierig mit mir. Ich dachte schon ich kriege das gar nicht mehr hin. 😀
|
glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
Ich bekomme hier eine Meldung, mit der ich nichts anfangen kann. soma@compi:~/Videos$ source ~/whisper/.venv/bin/activate
(.venv) soma@compi:~/Videos$ whisper test.mp4 --model medium --language German --output_format srt
100%|█████████████████████████████████████| 1.42G/1.42G [03:54<00:00, 6.53MiB/s]
Traceback (most recent call last):
File "/home/soma/whisper/.venv/bin/whisper", line 8, in <module>
sys.exit(cli())
^^^^^
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/whisper/transcribe.py", line 458, in cli
model = load_model(model_name, device=device, download_root=model_dir)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/whisper/__init__.py", line 156, in load_model
return model.to(device)
^^^^^^^^^^^^^^^^
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1160, in to
return self._apply(convert)
^^^^^^^^^^^^^^^^^^^^
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 810, in _apply
module._apply(fn)
[Previous line repeated 2 more times]
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 833, in _apply
param_applied = fn(param)
^^^^^^^^^
File "/home/soma/whisper/.venv/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1158, in convert
return t.to(device, dtype if t.is_floating_point() or t.is_complex() else None, non_blocking)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 20.00 MiB. GPU 0 has a total capacty of 3.81 GiB of which 2.19 MiB is free. Including non-PyTorch memory, this process has 3.79 GiB memory in use. Of the allocated memory 3.71 GiB is allocated by PyTorch, and 6.82 MiB is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF
(.venv) soma@compi:~/Videos$ Wo genau müsste die srt Datei denn sein? Im gleichen Ordner wie das Video?
|
verdooft
Anmeldungsdatum: 15. September 2012
Beiträge: 4286
|
Im Ordner, in dem du gerade bist. Kann man damit ändern: --output_dir OUTPUT_DIR, -o OUTPUT_DIR
directory to save the outputs (default: .) CUDA out of memory
Da hat der Videospeicher nicht gereicht. Entweder ein kleineres Modell nehmen, oder das Ganze auf der CPU laufen lassen. Wobei mich gerade wundert, dass bei dir die GPU verwendet wird, weil: --device DEVICE device to use for PyTorch inference (default: cpu) Bei anderen KI Anwendungen kann man manchmal teilweise die GPU und teilweise die CPU verwenden, davon sehe ich in der Hilfe aber nichts. whisper.cpp unterstützt übrigens auch quantisierte Modelle.
|
glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
Kleinere Videos nehmen ist doof. Dann lieber auf der CPU. Wie mache ich das?
|
verdooft
Anmeldungsdatum: 15. September 2012
Beiträge: 4286
|
Versuchs mal mit:
--device cpu
Das sollte eigentlich Standard sein, aber bei dir wird ja offensichtlich CUDA verwendet. Kleineres Modell meine ich, statt medium irgendwas kleineres. Aber die Spracherkennung ist dann schlechter. Ich wollte mal ein 30+ Stunden Video (bzw. das extrahierte Audio) mit large-v2 transkribieren, da reichten 64 GB RAM nicht.
|
glückspilz
(Themenstarter)
Anmeldungsdatum: 26. November 2007
Beiträge: 257
Wohnort: Nimmerland
|
Diesmal hat es geklappt. Es hat die Datei ausgespuckt. Nochmals vielen Dank!!! Ohne dich hätte ich das nie hingekriegt. 😀
|