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

小结

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

相关推荐
To_OC43 分钟前
搭 RAG 的第一个坎:网页检索答非所问?聊聊文档加载与分块的那些坑
人工智能·llm·agent
科技林总44 分钟前
图像处理领域的技术发展
人工智能·深度学习·计算机视觉
lauo1 小时前
掌心核爆:iQOO首款小平板搭载2nm骁龙8E6,开启AI原生计算的移动终端新纪元
前端·人工智能·智能手机·重构·电脑·ai-native
wenb1n1 小时前
MySQL诊断系列(3/6):索引分析——5个SQL揪出“僵尸索引”
数据库·人工智能·编程语言
阿里云大数据AI技术1 小时前
从向量存储到 Agentic 数据基础设施:Paimon × Milvus 如何构建 AI 原生多模态数据湖
人工智能·agent
字节跳动视频云技术团队1 小时前
一句话上线 AI Agent 应用:火山 Supabase + IGA Pages 全栈部署实践
人工智能·agent
QN1幻化引擎1 小时前
SFA 信号场注意力:用8KB参数换248x KV Cache压缩,边缘设备也能跑长序列
人工智能·算法·gitee·gitlab
xlrqx1 小时前
家电清洗培训课程类别、培训方式及费用情况究竟有哪些
大数据·python
神奇小汤圆1 小时前
为什么 skills 装得越多,AI 越笨?最火的那个 skill 只有一句话
人工智能
段一凡-华北理工大学1 小时前
向量数据库实战:选型、调优与落地~系列文章03:向量相似度算法全解:余弦、欧氏、内积,到底该用哪个?
大数据·数据库·人工智能·算法·机器学习·向量相似度·高炉炼铁