24-12-28-pytorch深度学习中音频I/O 中遇到的问题汇总

文章目录

pytorch深度学习中音频I/O 中遇到的问题汇总

问题1:音频文件格式的读取问题

参考链接:torchaudio 加载wav报错 Couldn't find appropriate backend to handle uri *** and format None

主要是音频格式读取的问题,读取 '.wav' 或 '.gsm' 文件

python 复制代码
metadata = torchaudio.info(SAMPLE_WAV)
print(metadata)

metadata = torchaudio.info(SAMPLE_GSM)
print(metadata)

这里的办法处理参考上面的链接外,可以采用在pytorch终端中 pip install soundfile 的办法。

可以通过一下代码查看 soundfile 库文件提供的可打开的文件格式。

python 复制代码
import soundfile as sf
print(sf.available_formats())

问题2:音频文件绘图问题

参考链接:OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.解决

主要问题,会报下面一大堆话,如下所示:

python 复制代码
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program.
That is dangerous, since it can degrade performance or cause incorrect results. The best thing to do is to ensure that only a single OpenMP runtime is linked into the process, e.g. by avoiding static linking of the OpenMP runtime in any library. 
As an unsafe, unsupported, undocumented workaround you can set the environment variable KMP_DUPLICATE_LIB_OK=TRUE to allow the program to continue to execute, but that may cause crashes or silently produce incorrect results. 
For more information, please see http://www.intel.com/software/products/support/.

主要问题是:多个环境中有这个 libiomp5md.dll 动态库,解决办法除了参考上面链接外。

(1) 可以使用 everything 软件,查找 libiomp5md.dll ,可以看到多个 libiomp5md.dll 文件,可以只留下所使用环境中的 libiomp5md.dll 文件,其他的 libiomp5md.dll 文件重命名为 libiomp5md__.dll

(2)或者 精准定位,只重命名 \Python312\site-packages\torch\lib 下的 libiomp5md.dll

小结

  看教程是一回事,自己做起来又是另一回事,会发现很多层出不穷的问题,多记录,多思考,多查资料,慢慢积累,终有所获。

相关推荐
JavaPub-rodert7 分钟前
王仕宇RAG 实战教程(二):从 0 搭建一个可运行的 RAG 知识库——Embedding、Qdrant 与问答实战
人工智能·embedding
Setsuna_F_Seiei14 分钟前
前端的 AI 学习之路 01 之 Agent API 调用 - 和 Agent 的基础对话
前端·人工智能·ai编程
咔咔学姐kk1 小时前
小白程序员必收藏:轻松入门AI Agent开发,大厂校招新风口!
人工智能·深度学习·ai·程序员·大模型·就业·大模型学习
小陈的进阶之路1 小时前
Claude Code辅助测试:导入篇skills
python·自动化
2601_967097221 小时前
园区巡检机器人推荐:4项评估维度与主流产品横评
大数据·人工智能·信息可视化
stuartevil1 小时前
零基础怎么用AI文生漫剧做出一条完整视频
人工智能·音视频
极客猴子2 小时前
能提取抖音视频文案的APP推荐:短视频文案工具合集
人工智能·智能手机·音视频·语音识别
sel_92 小时前
【强化学习】Hands-on Modern RL项目实践|OPD 算法完整解析
人工智能·深度学习·算法·机器学习·语言模型
xushichang123_2 小时前
Agentic AI 应用 Token 开销居高不下,可借助哪些云平台与架构实现成本管控?
人工智能
whcyhhh2 小时前
头歌实践教学平台:大数据存储2023(六)
大数据·数据库·python