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

小结

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

相关推荐
WSSWWWSSW3 小时前
Seaborn数据可视化实战:Seaborn数据可视化基础-从内置数据集到外部数据集的应用
python·信息可视化·数据分析·matplotlib·seaborn
Small___ming3 小时前
Matplotlib 可视化大师系列(七):专属篇 - 绘制误差线、等高线与更多特殊图表
python·信息可视化·matplotlib
技术与健康3 小时前
LLM实践系列:利用LLM重构数据科学流程03- LLM驱动的数据探索与清洗
大数据·人工智能·重构
张小九994 小时前
Foldseek快速蛋白质结构比对
人工智能
云卓SKYDROID5 小时前
无人机延时模块技术难点解析
人工智能·无人机·高科技·云卓科技·延迟摄像
神齐的小马5 小时前
机器学习 [白板推导](十三)[条件随机场]
人工智能·机器学习
荼蘼5 小时前
CUDA安装,pytorch库安装
人工智能·pytorch·python
@Wufan6 小时前
【机器学习】7 Linear regression
人工智能·机器学习·线性回归
杨荧6 小时前
基于Python的农作物病虫害防治网站 Python+Django+Vue.js
大数据·前端·vue.js·爬虫·python
cxr8286 小时前
自动化知识工作AI代理的工程与产品实现
运维·人工智能·自动化