解决| “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 重新编译库文件。



相关文章
用IAR打开STM8时,出现“Unable to create configuration 'Debug' using tool chain ‘STM8’
用IAR打开STM8时,出现“Unable to create configuration 'Debug' using tool chain ‘STM8’
417 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
454 0
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
gdalinfo: error while loading shared libraries: libgdal.so.30: cannot open shared object file: No su
184 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.
|
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
|
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
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
216 0
|
关系型数据库 MySQL Linux
error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or
error while loading shared libraries: libnuma.so.1: cannot open shared object file: No such file or
|
并行计算 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.
322 0
|
并行计算
解决Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.
解决Error #15: Initializing libiomp5.dylib, but found libomp.dylib already initialized.
412 0
下一篇
无影云桌面