AttributeError: module 'ffmpeg' has no attribute 'Error' #16

Closed
opened 2023-02-21 03:36:50 +00:00 by mrchucksneed · 7 comments
Transcribing file: ./voices\JayDee\1.wav
Traceback (most recent call last):
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\audio.py", line 42, in load_audio
    ffmpeg.input(file, threads=0)
AttributeError: module 'ffmpeg' has no attribute 'input'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 384, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1024, in process_api
    result = await self.call_function(
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 836, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread
    return await future
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run
    result = context.run(func, *args)
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 584, in tracked_fn
    response = fn(*args)
  File "C:\Tortoise\ai-voice-cloning\src\webui.py", line 181, in prepare_dataset_proxy
    return prepare_dataset( get_voices(load_latents=False)[voice], outdir=f"./training/{voice}/", language=language, progress=progress )
  File "C:\Tortoise\ai-voice-cloning\src\utils.py", line 508, in prepare_dataset
    result = whisper_model.transcribe(file, language=language if language else "English")
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\transcribe.py", line 84, in transcribe
    mel = log_mel_spectrogram(audio)
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\audio.py", line 111, in log_mel_spectrogram
    audio = load_audio(audio)
  File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\audio.py", line 46, in load_audio
    except ffmpeg.Error as e:
AttributeError: module 'ffmpeg' has no attribute 'Error'

Getting this whenever I try to start training, I followed the instructions here but it's not made a difference. Here's my output after following those instructions:

(venv) C:\Tortoise\ai-voice-cloning>python -m pip uninstall ffmpeg ffmpeg-python
WARNING: Skipping ffmpeg as it is not installed.
Found existing installation: ffmpeg-python 0.2.0
Uninstalling ffmpeg-python-0.2.0:
  Would remove:
    c:\tortoise\ai-voice-cloning\venv\lib\site-packages\ffmpeg\*
    c:\tortoise\ai-voice-cloning\venv\lib\site-packages\ffmpeg_python-0.2.0.dist-info\*
Proceed (Y/n)? y
  Successfully uninstalled ffmpeg-python-0.2.0

(venv) C:\Tortoise\ai-voice-cloning>python -m pip install ffmpeg-python
Collecting ffmpeg-python
  Using cached ffmpeg_python-0.2.0-py3-none-any.whl (25 kB)
Requirement already satisfied: future in c:\tortoise\ai-voice-cloning\venv\lib\site-packages (from ffmpeg-python) (0.18.3)
Installing collected packages: ffmpeg-python
Successfully installed ffmpeg-python-0.2.0

I also added ffmpeg to my /bin/ folder as instructed here

Using bbc2d26289 on Windows 10, R7 5700X, RX 6900 XTXH, 16GB RAM.

Many thanks.

``` Transcribing file: ./voices\JayDee\1.wav Traceback (most recent call last): File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\audio.py", line 42, in load_audio ffmpeg.input(file, threads=0) AttributeError: module 'ffmpeg' has no attribute 'input' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\routes.py", line 384, in run_predict output = await app.get_blocks().process_api( File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 1024, in process_api result = await self.call_function( File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\blocks.py", line 836, in call_function prediction = await anyio.to_thread.run_sync( File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\to_thread.py", line 31, in run_sync return await get_asynclib().run_sync_in_worker_thread( File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 937, in run_sync_in_worker_thread return await future File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\anyio\_backends\_asyncio.py", line 867, in run result = context.run(func, *args) File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\gradio\helpers.py", line 584, in tracked_fn response = fn(*args) File "C:\Tortoise\ai-voice-cloning\src\webui.py", line 181, in prepare_dataset_proxy return prepare_dataset( get_voices(load_latents=False)[voice], outdir=f"./training/{voice}/", language=language, progress=progress ) File "C:\Tortoise\ai-voice-cloning\src\utils.py", line 508, in prepare_dataset result = whisper_model.transcribe(file, language=language if language else "English") File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\transcribe.py", line 84, in transcribe mel = log_mel_spectrogram(audio) File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\audio.py", line 111, in log_mel_spectrogram audio = load_audio(audio) File "C:\Tortoise\ai-voice-cloning\venv\lib\site-packages\whisper\audio.py", line 46, in load_audio except ffmpeg.Error as e: AttributeError: module 'ffmpeg' has no attribute 'Error' ``` Getting this whenever I try to start training, I followed the instructions [here](https://git.ecker.tech/mrq/ai-voice-cloning/wiki/Issues#user-content-attributeerror-module-ffmpeg-has-no-attribute-input) but it's not made a difference. Here's my output after following those instructions: ``` (venv) C:\Tortoise\ai-voice-cloning>python -m pip uninstall ffmpeg ffmpeg-python WARNING: Skipping ffmpeg as it is not installed. Found existing installation: ffmpeg-python 0.2.0 Uninstalling ffmpeg-python-0.2.0: Would remove: c:\tortoise\ai-voice-cloning\venv\lib\site-packages\ffmpeg\* c:\tortoise\ai-voice-cloning\venv\lib\site-packages\ffmpeg_python-0.2.0.dist-info\* Proceed (Y/n)? y Successfully uninstalled ffmpeg-python-0.2.0 (venv) C:\Tortoise\ai-voice-cloning>python -m pip install ffmpeg-python Collecting ffmpeg-python Using cached ffmpeg_python-0.2.0-py3-none-any.whl (25 kB) Requirement already satisfied: future in c:\tortoise\ai-voice-cloning\venv\lib\site-packages (from ffmpeg-python) (0.18.3) Installing collected packages: ffmpeg-python Successfully installed ffmpeg-python-0.2.0 ``` I also added ffmpeg to my /bin/ folder as instructed [here](https://git.ecker.tech/mrq/ai-voice-cloning/wiki/Training#user-content-prepare-dataset) Using bbc2d26289 on Windows 10, R7 5700X, RX 6900 XTXH, 16GB RAM. Many thanks.
Owner

Any way you can zip up and send your venv folder? I might be able to figure it out if I can probe the current state.

Windows 10, [...] RX 6900 XTXH

Actually, not to rain on your parade, but, on Windows at least, finetuning/training is only on Nvidia cards, as I haven't been able to find a way to cram DirectML wrappers into DLAS yet.

While it doesn't exactly solve your issue, it'd be best to use a Colab notebook to train, as you're most definitely going to run into being unable to train with your AMD card, on Windows at least (until I find a way to get DLAS to use DirectML, which may not even work).

Any way you can zip up and send your `venv` folder? I might be able to figure it out if I can probe the current state. >Windows 10, \[...\] RX 6900 XTXH Actually, not to rain on your parade, but, on Windows at least, finetuning/training is only on Nvidia cards, as I haven't been able to find a way to cram DirectML wrappers into DLAS yet. While it doesn't exactly solve your issue, it'd be best to use a Colab notebook to train, as you're most definitely going to run into being unable to train with your AMD card, on Windows at least (until I find a way to get DLAS to use DirectML, which may not even work).
Author

Any way you can zip up and send your venv folder? I might be able to figure it out if I can probe the current state.

Windows 10, [...] RX 6900 XTXH

Actually, not to rain on your parade, but, on Windows at least, finetuning/training is only on Nvidia cards, as I haven't been able to find a way to cram DirectML wrappers into DLAS yet.

While it doesn't exactly solve your issue, it'd be best to use a Colab notebook to train, as you're most definitely going to run into being unable to train with your AMD card, on Windows at least (until I find a way to get DLAS to use DirectML, which may not even work).

I assume training works for AMD on Linux then?
I've attached my venv folder anyway.

https://litter.catbox.moe/hyyx4h.7z

> Any way you can zip up and send your `venv` folder? I might be able to figure it out if I can probe the current state. > > >Windows 10, \[...\] RX 6900 XTXH > > Actually, not to rain on your parade, but, on Windows at least, finetuning/training is only on Nvidia cards, as I haven't been able to find a way to cram DirectML wrappers into DLAS yet. > > While it doesn't exactly solve your issue, it'd be best to use a Colab notebook to train, as you're most definitely going to run into being unable to train with your AMD card, on Windows at least (until I find a way to get DLAS to use DirectML, which may not even work). I assume training works for AMD on Linux then? I've attached my venv folder anyway. https://litter.catbox.moe/hyyx4h.7z
Owner

I assume training works for AMD on Linux then?

Should be, I haven't tested it, but if it's anything like getting tortoise-tts working under ROCm, it's just as easy as running ./setup-rocm.sh and making sure you already have ROCm drivers/runtime installed.

I've attached my venv folder anyway.

> I assume training works for AMD on Linux then? Should be, I haven't tested it, but if it's anything like getting tortoise-tts working under ROCm, it's just as easy as running `./setup-rocm.sh` and making sure you already have ROCm drivers/runtime installed. > I've attached my venv folder anyway.
Owner

Took a small bit of elbow grease to get it to work (for simplicity I just thrown it at C:\Tortoise\ai-voice-cloning\ so I don't need to edit some paths, and had to edit .\venv\pyvenv.conf with my python39 path) and did get it to replicate, but I humored myself with just running:

.\venv\Scripts\activate.bat
pip uninstall ffmpeg-python
pip install ffmpeg-python

And it worked: image

I'll zip the venv back up and send it to you.

Took a small bit of elbow grease to get it to work (for simplicity I just thrown it at `C:\Tortoise\ai-voice-cloning\` so I don't need to edit some paths, and had to edit `.\venv\pyvenv.conf` with my python39 path) and did get it to replicate, but I humored myself with just running: ``` .\venv\Scripts\activate.bat pip uninstall ffmpeg-python pip install ffmpeg-python ``` And it worked: ![image](/attachments/49466fe7-1439-4791-b0c0-32700e0485bb) I'll zip the venv back up and send it to you.
Author

Took a small bit of elbow grease to get it to work (for simplicity I just thrown it at C:\Tortoise\ai-voice-cloning\ so I don't need to edit some paths, and had to edit .\venv\pyvenv.conf with my python39 path) and did get it to replicate, but I humored myself with just running:

.\venv\Scripts\activate.bat
pip uninstall ffmpeg-python
pip install ffmpeg-python

And it worked: image

I'll zip the venv back up and send it to you.

Thanks very much for your prompt response.
I might have to download a Linux distro and test it there, if you think it should work with GPU accel

> Took a small bit of elbow grease to get it to work (for simplicity I just thrown it at `C:\Tortoise\ai-voice-cloning\` so I don't need to edit some paths, and had to edit `.\venv\pyvenv.conf` with my python39 path) and did get it to replicate, but I humored myself with just running: > ``` > .\venv\Scripts\activate.bat > pip uninstall ffmpeg-python > pip install ffmpeg-python > ``` > > And it worked: ![image](/attachments/49466fe7-1439-4791-b0c0-32700e0485bb) > > I'll zip the venv back up and send it to you. Thanks very much for your prompt response. I might have to download a Linux distro and test it there, if you think it should work with GPU accel
Owner

Almost forgot the venv. Should be as easy as deleting your old one and dropping this in place.

I might have to download a Linux distro and test it there, if you think it should work with GPU accel

The hardest part is actually getting ROCm drivers/runtime working, since it didn't seem to work at first on an Arch Linux flavor I had used. I imagine on a Debian/Debian-variant it'd be easy peasy.

Almost forgot the [venv](https://litter.catbox.moe/sjrj2k.7z). Should be as easy as deleting your old one and dropping this in place. > I might have to download a Linux distro and test it there, if you think it should work with GPU accel The hardest part is actually getting ROCm drivers/runtime working, since it didn't seem to work at first on an Arch Linux flavor I had used. I imagine on a Debian/Debian-variant it'd be easy peasy.
Author

Almost forgot the venv. Should be as easy as deleting your old one and dropping this in place.

I might have to download a Linux distro and test it there, if you think it should work with GPU accel

The hardest part is actually getting ROCm drivers/runtime working, since it didn't seem to work at first on an Arch Linux flavor I had used. I imagine on a Debian/Debian-variant it'd be easy peasy.

image

Thank you bud, that's resolved it.

> Almost forgot the [venv](https://litter.catbox.moe/sjrj2k.7z). Should be as easy as deleting your old one and dropping this in place. > > > I might have to download a Linux distro and test it there, if you think it should work with GPU accel > > The hardest part is actually getting ROCm drivers/runtime working, since it didn't seem to work at first on an Arch Linux flavor I had used. I imagine on a Debian/Debian-variant it'd be easy peasy. ![image](/attachments/595bf9e7-0f74-4a83-858b-ce5116714a74) Thank you bud, that's resolved it.
mrq closed this issue 2023-02-21 18:24:49 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mrq/ai-voice-cloning#16
No description provided.