ddPn08 / rvc-webui

liujing04/Retrieval-based-Voice-Conversion-WebUI reconstruction project
MIT License
489 stars 81 forks source link

Can't train or infer in macos // issue with ffmpeg #72

Open Cptn-Reynolds opened 1 year ago

Cptn-Reynolds commented 1 year ago

I saw there is a macos version of the gui and got it running.

I was able to "train index" one time and "train", but when trying to use "Inference" afterwards, it crashed with an ffmpeg error.

Error while train indexing

Using MPS
Traceback (most recent call last):
  File "/Users/cptnray/rvc-webui/lib/rvc/utils.py", line 36, in load_audio
    ffmpeg.input(file, threads=0)
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/ffmpeg/_run.py", line 313, in run
    process = run_async(
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/ffmpeg/_run.py", line 284, in run_async                                  | 0/24 [00:00<?, ?it/s]
    return subprocess.Popen(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/routes.py", line 439, in run_predict
    output = await app.get_blocks().process_api(
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1384, in process_api
    result = await self.call_function(
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/blocks.py", line 1103, in call_function
    prediction = await utils.async_iteration(iterator)
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 343, in async_iteration
    return await iterator.__anext__()
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 336, in __anext__
    return await anyio.to_thread.run_sync(
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/anyio/to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 319, in run_sync_iterator_async
    return next(iterator)
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/gradio/utils.py", line 688, in gen_wrapper
    yield from f(*args, **kwargs)
  File "/Users/cptnray/rvc-webui/modules/tabs/training.py", line 74, in train_index_only
    split.preprocess_audio(
  File "/Users/cptnray/rvc-webui/lib/rvc/preprocessing/split.py", line 195, in preprocess_audio
    write_mute(mute_wav_path, speaker_id, waves_dir, waves16k_dir, sampling_rate)
  File "/Users/cptnray/rvc-webui/lib/rvc/preprocessing/split.py", line 65, in write_mute
    tmp_audio = load_audio(mute_wave_filename, sampling_rate)
  File "/Users/cptnray/rvc-webui/lib/rvc/utils.py", line 41, in load_audio
    raise RuntimeError(f"Failed to load audio: {e}")
RuntimeError: Failed to load audio: [Errno 2] No such file or directory: 'ffmpeg'
2023-07-24 20:52:26 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/api/predict "HTTP/1.1 500 Internal Server Error"
2023-07-24 20:52:26 | INFO | httpx | HTTP Request: POST http://127.0.0.1:7860/reset "HTTP/1.1 200 OK"
Cptn-Reynolds commented 1 year ago

Error during Inference

Error: Traceback (most recent call last):
  File "/Users/cptnray/rvc-webui/modules/utils.py", line 23, in load_audio
    ffmpeg.input(file, threads=0)
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/ffmpeg/_run.py", line 313, in run
    process = run_async(
  File "/Users/cptnray/rvc-webui/venv/lib/python3.10/site-packages/ffmpeg/_run.py", line 284, in run_async
    return subprocess.Popen(
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 971, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/subprocess.py", line 1863, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ffmpeg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/cptnray/rvc-webui/modules/tabs/inference.py", line 108, in infer
    audio = model.single(
  File "/Users/cptnray/rvc-webui/modules/models.py", line 124, in single
    audio = load_audio(input_audio, 16000)
  File "/Users/cptnray/rvc-webui/modules/utils.py", line 28, in load_audio
    raise RuntimeError(f"Failed to load audio: {e}")
RuntimeError: Failed to load audio: [Errno 2] No such file or directory: 'ffmpeg'
ddPn08 commented 1 year ago

To use this software, ffmpeg must be installed on your PC. If you are using MacOS, you can install ffmpeg using homebrew.

Cptn-Reynolds commented 1 year ago

According to the Requirements.txt, the ffmpeg-python package is installed in the python environment when running webui.sh - shouldn't this be enough?

ddPn08 commented 1 year ago

I recognize that ffmpeg-python is a library for operating ffmpeg installed on os. So you need ffmpeg installed.

Cptn-Reynolds commented 1 year ago

I see, thanks for clarifying :) Will update you after testing

noisyneil commented 1 year ago

Could you possibly provide a link to the instructions for macOS installation? It's all a bit bewildering.