解决在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下的虚拟环境的文件。发现有时候见山不是山,希望能帮助一些人。

相关推荐
程序猿追1 天前
那个右下角的小数字怎么“卡”住我打字——我用 HarmonyOS 自己写了一个字数限制输入框
pytorch·华为·harmonyos
闵孚龙1 天前
《PyTorch 深度修炼》Dataset 和 DataLoader:数据如何喂给模型
人工智能·pytorch·python
bryant_meng1 天前
【VAE】From Pixels to Faces: Building a VAE from Scratch
pytorch·vae·log-sigma2·重参数
砍材农夫1 天前
python环境|conda安装和使用(1)
开发语言·后端·python·conda
装不满的克莱因瓶1 天前
了解多标签图像分类方法——从Sigmoid输出到真实世界复杂视觉理解
人工智能·pytorch·python·深度学习·机器学习·分类·数据挖掘
冷小鱼1 天前
TensorFlow 2.21 进阶实战:从训练优化到生产部署的完整指南
人工智能·pytorch·python·tensorflow
冷小鱼1 天前
PyTorch 2.12 完全指南:从动态图到编译优化的深度学习框架演进
人工智能·pytorch·深度学习
IRevers1 天前
【大模型】Gemma4在ROCm和vLLM部署
人工智能·pytorch·深度学习·大模型·datawhale·vllm·amdev
盼小辉丶1 天前
PyTorch强化学习实战(14)——优先经验回放机制
pytorch·python·深度学习·强化学习
匆匆整棹还1 天前
mamba的安装和版本对应
conda