解决| “OMP: Error #15: Initializing libiomp5md.dll,”

简介: 解决| “OMP: Error #15: Initializing libiomp5md.dll,”

在进行机器学习【pytorch框架】的时候,有事会报如下错,以前我是通过削减Batch_size值,自己仔细想了想,这样做未免有点不解决根本问题,系统报错提示:


KMP_DUPLICATE_LIB_OK=TRUE 可以解决,我顺势查阅了下 KMP_DUPLICATE_LIB_OK=TRUE 。得到的二级结论如下:


这个有可能是因为系统环境中存在多个版本的OpenMP库导致,可以把环境变量KMP_DUPLICATE_LIB_OK设置成True试试。
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/.


在代码中解决方案如下:

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

或:


  1. 查看文件链接的OpenMP library, 只使用一个。


  1. 推荐使用动态库:libiomp5md.dll


  1. 如果第三方库使用libguide40.dll, 使用libiomp5md.dll 重新编译库文件。



相关文章
|
7月前
|
消息中间件
mq安装出现的问题 Unable to load crypto library. Failed with error:
mq安装出现的问题 Unable to load crypto library. Failed with error:
175 0
|
6月前
No rule to make target ‘.xxxxxxxx‘, needed by ‘debug/xxxx.cpp‘. Stop.
No rule to make target ‘.xxxxxxxx‘, needed by ‘debug/xxxx.cpp‘. Stop.
|
6月前
|
机器学习/深度学习 并行计算 安全
ImportError: DLL load failed while importing libpaddle: 找不到指定的模块问题
【6月更文挑战第7天】ImportError: DLL load failed while importing libpaddle: 找不到指定的模块问题
559 0
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
collect2: fatal error: ld terminated with signal 11 [Segmentation fault], core dumped
498 0
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized.
|
TensorFlow 算法框架/工具 Python
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
成功解决File "frozen importlib._bootstrap", line 219, in _call_with_frames_removed ImportError: DLL lo
|
Unix Linux 异构计算
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See /var/log/nv
成功解决 ERROR: An error occurred while performing the step: “Building kernel modules“. See  /var/log/nv
VS2022编译GDAL库报错: fatal error U1050: PROJ_INCLUDE should be defined. PROJ >= 6 is a required depende
VS2022编译GDAL库报错: fatal error U1050: PROJ_INCLUDE should be defined. PROJ >= 6 is a required depende
230 0
|
并行计算 Python
报错:OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized.
报错:OMP: Error #15: Initializing libomp.dylib, but found libiomp5.dylib already initialized.
332 0
|
并行计算
解决Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.
解决Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.
438 0