【BUG】OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.

主要参考:https://blog.csdn.net/cwwhdyg/article/details/129507866

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 al
low 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,删除或者拷贝出多的

例如在paddleocr这个虚拟环境出错

进入虚拟环境所在文件夹

C:\Users\admin\AppData\Local\conda\conda\envs\paddleocr

搜索

【BUG】OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized._第1张图片

结果

发现paddle、torch、paddleocr包都有这个,将paddleocr包下结果删除就行(仅一个)

【BUG】OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized._第2张图片

网上常见的方法

在pycharm里调试相关程序时,在程序内添加如下语句。

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

你可能感兴趣的:(BUG,bug)