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

相关推荐
伞伞悦读15 小时前
【第12期】Windows 开发环境备份与恢复:软件、环境变量、Git、conda 和 Docker 卷完整方案
git·docker·conda
柳絮飞祭奠18 小时前
03-Dify知识库搭建实战专利文档TXT+Excel
人工智能·pytorch·自然语言处理·集成学习
一次旅行1 天前
Attention机制从数学到工程:拆解缩放点积+多头注意力|附可运行PyTorch实现与踩坑指南
人工智能·pytorch·python
cooldream20091 天前
Conda 镜像源 404 错误完全解决指南
conda·ai编程
ai小陈2 天前
PyTorch多GPU分布式训练实战:从单卡脚本迁移到DDP
服务器·人工智能·pytorch·分布式·深度学习·ai·gpu算力
EW Frontier2 天前
CMA-Former:基于级联多头注意力 Transformer 的 DOA 波达方向估计(PyTorch 实现)
pytorch·深度学习·transformer·doa估计
wangchen_03 天前
PyTorch
人工智能·pytorch·python
CODER03043 天前
本地部署语音识别框架FunAudioLLM——Fun-ASR-Nano-2512模型
人工智能·conda·语音识别·audiolm
zhou135284822673 天前
Anaconda Distribution 安装使用文档与 Conda 常用命令详解
conda
%473 天前
DAY41
pytorch·python