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

小结

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

相关推荐
DatGuy19 分钟前
Week 33: 量子深度学习入门:参数化量子电路与混合模型构建
人工智能·深度学习
啊阿狸不会拉杆19 分钟前
《数字图像处理》第 12 章 - 目标识别
图像处理·人工智能·算法·计算机视觉·数字图像处理
huwei85326 分钟前
python设计通用表格类 带右键菜单
开发语言·windows·python
计算机毕业编程指导师26 分钟前
【计算机毕设选题】基于Spark的拉勾网招聘数据分析系统源码,Python+Django全流程
大数据·hadoop·python·spark·django·招聘·拉勾网
biyezuopinvip26 分钟前
基于深度学习的眼底图像分割方法研究与实现(论文)
人工智能·深度学习·毕业设计·论文·毕业论文·基于深度学习的·眼底图像分割方法研究与实现
duyinbi751729 分钟前
TOOD_R50_FPN_Anchor-Based_1x_COCO_列车悬挂部件检测分类实战
python
老蒋每日coding29 分钟前
AI Agent 设计模式系列(九)——学习和适应模式
人工智能·学习·设计模式
Das130 分钟前
【机器学习】05_决策树
人工智能·决策树·机器学习
学习3人组32 分钟前
大模型轻量化调优(昇腾平台方向)岗位技术名词拆解
人工智能·python
知乎的哥廷根数学学派33 分钟前
基于物理引导和不确定性量化的轻量化神经网络机械退化预测算法(Python)
人工智能·pytorch·python·深度学习·神经网络·算法·机器学习