解决在win10找不到site-packages\torch\lib\shm.dll“ or one of its dependencies 问题

环境:win10

工具:pycharm

运行yolov11的测试时报错:找不到site-packages\torch\lib\shm.dll" or one of its dependencies

本来顺着这个问题发现都让重新装pytorch,找到下载链接

download.pytorch.org/whl/torch_stable.html,打开就一堆,百思不得其舒服解

并且我懒,so......faint......我不打算这么做。

于是改换思路,单独启动torch,import torch,发现依旧报错

但错误变成了:OMP: Error #15: Initializing libomp.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://openmp.llvm.org/

找到知乎的帖子(感谢这位博主)(22 封私信 / 30 条消息) 关于OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.错误解决方法 - 知乎 (zhihu.com)

本问题出现主要是因为pytorch包中包含了名为libiomp5md.dll的文件 ,与Anaconda环境中的同一个文件出现了某种冲突,所以需要删除一个。

删除多余的dll文件,我的文件是env下的虚拟环境的文件。发现有时候见山不是山,希望能帮助一些人。

相关推荐
龙文浩_17 小时前
AI中NLP的文本张量表示方法在自然语言处理中的演进与应用
人工智能·pytorch·深度学习·神经网络·自然语言处理
ZhiqianXia19 小时前
Pytorch 学习笔记(17):decompositions.py —— 算子分解的百科全书
pytorch·笔记·学习
星马梦缘19 小时前
强化学习实战5——BaseLine3使用自定义环境训练【输入状态向量】
pytorch·python·jupyter·强化学习·baseline3·gymnasium
ZhiqianXia20 小时前
PyTorch 笔记学习(15) : aot_autograd.py 解析
pytorch·笔记·学习
ZhiqianXia20 小时前
PyTorch 学习笔记(14):PyTorch/LLVM 编译栈
pytorch·笔记·学习
ZhiqianXia21 小时前
PyTorch 学习笔记(12):ATen C++ 算子引擎的完整架构之旅
pytorch·笔记·学习
星川皆无恙1 天前
Vision Transformer学习笔记:从 Attention 核心理论到 PyTorch 源码实战
pytorch·深度学习·transformer
龙文浩_1 天前
AI中NLP的自然语言处理中的文本预处理与特征工程
人工智能·pytorch·深度学习·神经网络·自然语言处理
tryCbest1 天前
Pip生成requirements.txt文件
python·pip
AI成长日志1 天前
【GitHub开源项目】推理优化技术栈全览:从PyTorch到专用引擎
pytorch·开源·github