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/.

出现这种问题,只需要在代码开头导入os
然后输入这行代码
import os
os.environ['KMP_DUPLICATE_LIB_OK'] = 'TRUE'
博客内容讨论了在运行程序时遇到的OpenMP库重复初始化错误,提到了错误信息`OMP:Error#15:Initializinglibiomp5md.dll,butfoundlibiomp5md.dllalreadyinitialized.`。解决方案是在代码中引入os模块,并设置环境变量`KMP_DUPLICATE_LIB_OK=TRUE`以允许程序继续执行,但警告这样做可能影响性能或导致不正确的结果。建议避免静态链接OpenMP运行时库以确保程序的正确性和性能。
3131

被折叠的 条评论
为什么被折叠?



