尝试musicgen模型,torchaudio Failed to load audio from

2023-12-19 20:56:25

Traceback (most recent call last):
? File "<stdin>", line 1, in <module>
? File "/data/miniconda3/envs/musicgen/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py", line 256, in load
? ? return _fallback_load(filepath, frame_offset, num_frames, normalize, channels_first, format)
? File "/data/miniconda3/envs/musicgen/lib/python3.9/site-packages/torchaudio/backend/sox_io_backend.py", line 30, in _fail_load
? ? raise RuntimeError("Failed to load audio from {}".format(filepath))
RuntimeError: Failed to load audio from ./assets/bach.mp3

原因:

Starting 0.12, the MP3 decoder is switched to libavcodec. The error indicates that there is no installation of FFmpeg 4. Please install ffmpeg 4.?conda install 'ffmpeg<5'?should do in most cases.

解决方式:
conda install 'ffmpeg<5'

文章来源:https://blog.csdn.net/nangua06/article/details/135083981
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。