resemble-ai / resemble-enhance

AI powered speech denoising and enhancement
https://huggingface.co/spaces/ResembleAI/resemble-enhance
MIT License
1.09k stars 103 forks source link

PosixPath error when running on MacOS #11

Open symbion6 opened 6 months ago

symbion6 commented 6 months ago

Trying to run on MacOS, but to no avail. I've placed a "1.wav" file in the current folder and start resemble-enhance like this: resemble-enhance ./ ./ The same output is given when using an absolute path.

Output:

[2024-01-03 20:17:18,615] [INFO] [real_accelerator.py:161:get_accelerator] Setting ds_accelerator to mps (auto detect)
[2024-01-03 20:17:18,938] torch.distributed.elastic.multiprocessing.redirects: [WARNING] NOTE: Redirects are currently not supported in Windows or MacOs.
CUDA is not available but --device is set to cuda, using CPU instead
Processing 1.wav:   0%|                                   | 0/1 [00:00<?, ?it/s]
Traceback (most recent call last):
  File "/usr/local/bin/resemble-enhance", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/resemble_enhance/enhancer/__main__.py", line 100, in main
    dwav, sr = torchaudio.load(path)
               ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/torchaudio/_backend/utils.py", line 204, in load
    return backend.load(uri, frame_offset, num_frames, normalize, channels_first, format, buffer_size)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/torchaudio/_backend/sox.py", line 42, in load
    ret = torch.ops.torchaudio.sox_io_load_audio_file(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/torch/_ops.py", line 692, in __call__
    return self._op(*args, **kwargs or {})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: torchaudio::sox_io_load_audio_file() Expected a value of type 'str' for argument '_0' but instead found type 'PosixPath'.
Position: 0
Value: PosixPath('1.wav')
Declaration: torchaudio::sox_io_load_audio_file(str _0, int? _1, int? _2, bool? _3, bool? _4, str? _5) -> (Tensor _0, int _1)
Cast error details: Unable to cast Python instance of type <class 'pathlib.PosixPath'> to C++ type '?' (#define PYBIND11_DETAILED_ERROR_MESSAGES or compile in debug mode for details)
MisakaMikoto96 commented 6 months ago

same

artgadliba commented 4 months ago

I was able to run on MacOS. Previously, I had different type of error, related to git lfs. After I have installed it, i got another error: _pickle.UnpicklingError: invalid load key, 'v'. So later I found there are some arguments with default values, so I tried to change "--device" value to "cpu". And it seems to work. My audio file is processing, its on a half of way. Not sure it will be finished correctly, will let you know.

Give it a try, perhaps it will work for you too.

Update: yup, the enhancement done.

JonathanBonnaud commented 3 months ago

Hello, any update on this issue? I am getting the same error.

EDIT: I feel like installing ffmpeg resolved it.

HninLwin-byte commented 3 months ago

hello I got this error while running on Mac OS , I got nothing , just this . Could you please fix my bug if some one encounter this error too Screenshot 2567-03-28 at 02 59 41 (2)