Plachtaa / VITS-fast-fine-tuning

This repo is a pipeline of VITS finetuning for fast speaker adaptation TTS, and many-to-many voice conversion
Apache License 2.0
4.69k stars 703 forks source link

python scripts/denoise_audio.py 报错RuntimeError: torchaudio.backend.soundfile_backend.load requires soundfile #519

Closed jiangsiYang closed 9 months ago

jiangsiYang commented 9 months ago

Hi, 我在执行python scripts/denoise_audio.py 这一步骤时报错

D:\python\lib\site-packages\torchaudio_internal\module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available. warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.") D:\python\lib\site-packages\torchaudio_internal\module_utils.py:99: UserWarning: Failed to import soundfile. 'soundfile' backend is not available. warnings.warn("Failed to import soundfile. 'soundfile' backend is not available.") Traceback (most recent call last): File "D:\python\lib\runpy.py", line 192, in _run_module_as_main return _run_code(code, main_globals, None, File "D:\python\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "D:\python\Scripts\demucs.exe__main__.py", line 4, in File "D:\python\lib\site-packages\demucs\separate.py", line 17, in from .audio import AudioFile, convert_audio, save_audio File "D:\python\lib\site-packages\demucs\audio.py", line 10, in import lameenc ModuleNotFoundError: No module named 'lameenc' Traceback (most recent call last): File "scripts/denoise_audio.py", line 16, in wav, sr = torchaudio.load(f"./separated/htdemucs/{file}/vocals.wav", frame_offset=0, num_frames=-1, normalize=True, File "D:\python\lib\site-packages\torchaudio_internal\module_utils.py", line 121, in wrapped raise RuntimeError(f"{func.module}.{func.name} requires soundfile") RuntimeError: torchaudio.backend.soundfile_backend.load requires soundfile

我试过执行pip install soundfile 还是没有解决 E:\work\VITS-fast-fine-tuning>pip install soundfile Requirement already satisfied: soundfile in d:\python\lib\site-packages (0.12.1) Requirement already satisfied: cffi>=1.0 in d:\python\lib\site-packages (from soundfile) (1.16.0) Requirement already satisfied: pycparser in d:\python\lib\site-packages (from cffi>=1.0->soundfile) (2.21) 网上找了很多资料都没发现解决办法,请帮忙看看,谢谢!

jiangsiYang commented 9 months ago

pip list 查看已安装的包,如下,也发现有soundfile的 Package Version


absl-py 2.0.0 aiofiles 23.2.1 altair 5.1.2 annotated-types 0.6.0 antlr4-python3-runtime 4.9.3 anyio 3.7.1 attrs 23.1.0 audioread 3.0.1 backports.functools-lru-cache 1.6.6 cachetools 5.3.2 certifi 2023.7.22 cffi 1.16.0 charset-normalizer 3.3.2 click 8.1.7 cloudpickle 3.0.0 cn2an 0.5.22 colorama 0.4.6 contourpy 1.2.0 cycler 0.12.1 Cython 0.29.21 decorator 4.4.2 demucs 4.0.1 dora-search 0.1.12 einops 0.7.0 eng-to-ipa 0.0.2 exceptiongroup 1.1.3 fastapi 0.104.1 ffmpy 0.3.1 filelock 3.13.1 fonttools 4.44.0 fsspec 2023.10.0 google-auth 2.23.4 google-auth-oauthlib 1.0.0 gradio 4.1.1 gradio_client 0.7.0 grpcio 1.59.2 h11 0.14.0 httpcore 1.0.1 httpx 0.25.1 huggingface-hub 0.18.0 idna 3.4 imageio 2.32.0 imageio-ffmpeg 0.4.9 importlib-metadata 6.8.0 importlib-resources 6.1.0 indic-transliteration 2.3.37 inflect 7.0.0 jamo 0.4.1 jieba 0.42.1 Jinja2 3.1.2 joblib 1.3.2 jsonschema 4.19.2 jsonschema-specifications 2023.7.1 julius 0.2.7 kiwisolver 1.4.5 ko-pron 1.3 lameenc 1.6.3 librosa 0.9.2 llvmlite 0.41.1 Markdown 3.5.1 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib 3.3.1 mdurl 0.1.2 more-itertools 10.1.0 moviepy 1.0.3 mpmath 1.3.0 networkx 3.2.1 num-thai 0.0.5 numba 0.58.0 numpy 1.24.4 oauthlib 3.2.2 omegaconf 2.3.0 openai-whisper 20231105 OpenCC 1.1.1 openunmix 1.2.1 orjson 3.9.10 packaging 23.2 pandas 2.0.3 Pillow 10.0.1 pip 23.3.1 pkgutil_resolve_name 1.3.10 platformdirs 3.11.0 pooch 1.8.0 proces 0.1.7 proglog 0.1.10 protobuf 4.23.4 pyasn1 0.5.0 pyasn1-modules 0.3.0 pycparser 2.21 pydantic 2.4.2 pydantic_core 2.10.1 pydub 0.25.1 Pygments 2.16.1 pyopenjtalk-prebuilt 0.3.0 pyparsing 3.1.1 pypinyin 0.49.0 PySoundFile 0.9.0.post1 python-dateutil 2.8.2 python-multipart 0.0.6 pytz 2023.3.post1 PyYAML 6.0.1 referencing 0.30.2 regex 2023.10.3 requests 2.31.0 requests-oauthlib 1.3.1 resampy 0.4.2 retrying 1.3.4 rich 13.6.0 roman 4.1 rpds-py 0.12.0 rsa 4.9 scikit-learn 1.0.2 scipy 1.11.3 semantic-version 2.10.0 setuptools 68.2.2 shellingham 1.5.4 six 1.16.0 sniffio 1.3.0 soundfile 0.12.1 starlette 0.27.0 submitit 1.5.0 sympy 1.12 tensorboard 2.14.0 tensorboard-data-server 0.7.2 threadpoolctl 3.2.0 tiktoken 0.3.3 toml 0.10.2 tomlkit 0.12.0 toolz 0.12.0 torch 1.13.1+cu117 torchaudio 0.13.1+cu117 torchvision 0.14.1+cu117 tqdm 4.66.1 treetable 0.2.5 typer 0.9.0 typing_extensions 4.8.0 tzdata 2023.3 Unidecode 1.3.7 urllib3 2.0.7 uvicorn 0.24.0.post1 websockets 11.0.3 Werkzeug 3.0.1 wheel 0.41.3 zipp 3.17.0

jiangsiYang commented 9 months ago

怀疑soundfile 和 cffi 的version之间不兼容,卸载cffi 再重新安装后就可以了