错误#15:正在初始化libiomp5.dylib,但发现libiomp5.dylib已初始化 [英] Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized

查看:843
本文介绍了错误#15:正在初始化libiomp5.dylib,但发现libiomp5.dylib已初始化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用matplotlib时获取错误消息:

Getting the error message when using matplotlib:

错误#15:初始化libiomp5.dylib,但发现libiomp5.dylib 已经初始化 OMP:提示:这意味着OpenMP运行时的多个副本已链接到程序中.这很危险,因为它可以 降低性能或导致错误的结果.最好的事情 是为了确保仅将单个OpenMP运行时链接到 过程,例如通过避免在任何情况下静态链接OpenMP运行时 图书馆.作为不安全,不受支持,未记录的解决方法,您可以 设置环境变量KMP_DUPLICATE_LIB_OK = TRUE以允许 程序继续执行,但是可能会导致崩溃或无提示 产生不正确的结果.有关更多信息,请参见 http://www.intel.com/software/products/support/.

Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib 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/.

推荐答案

这似乎是MacOS问题.请执行以下操作以解决该问题:

This seems to be a MacOS problem. Do the following to solve the issue:

import os

os.environ['KMP_DUPLICATE_LIB_OK']='True'

在以下位置找到答案: https://github.com/dmlc/xgboost/issues/1715

Answer found at: https://github.com/dmlc/xgboost/issues/1715

这篇关于错误#15:正在初始化libiomp5.dylib,但发现libiomp5.dylib已初始化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆