模型训练 – 解决启动深度学习项目出现OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized问题
今天在开始跑一个深度学习项目时,在启动时,程序出现了以下的错误,
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
已经被初始化了导致的错误,这个有可能是因为系统环境中存在多个版本的OpenMP库导致,可能是由于你的电脑使用Anaconda管理了多个Python虚拟环境,并且每个环境中都安装了Pytorch库,导致每个环境中都有libiomp5md.dll
。
网上大多数人给出的解决方案就是修改系统的环境变量,如下
import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'True'
将KMP_DUPLICATE_LIB_OK
设置为True即可,但是我测试了有更加简单的办法就是重启电脑,重启电脑之后这个问题就会被修复。
本文作者:StubbornHuang
版权声明:本文为站长原创文章,如果转载请注明原文链接!
原文标题:模型训练 – 解决启动深度学习项目出现OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized问题
原文链接:https://www.stubbornhuang.com/2378/
发布于:2022年09月30日 14:57:51
修改于:2022年09月30日 14:57:51
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
评论
50