question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OMP: Error #15: Initializing libiomp5.dylib

See original GitHub issue

Followed Mujoco install, followed by full Gym installation.

Used Miniconda, py 3.6

On fresh OSX Mojave (right out of the box!)

Ran the following code:

import gym
import tensorflow as tf
from spinup import ddpg

env_name = 'Pendulum-v0'
env_fn       = lambda : gym.make(env_name)

ac_kwargs = {
        'hidden_sizes':[64,64], 
        'activation'  :tf.nn.relu
    }

logger_kwargs = {
    'output_dir'  : 'logs', 
    'exp_name'  :'pendulum_test'
    }

addl_kwargs = {
    'seed' : 42
}

ddpg(env_fn, ac_kwargs=ac_kwargs, logger_kwargs=logger_kwargs, **addl_kwargs)

Received following error on first build:

INFO:tensorflow:Assets added to graph. INFO:tensorflow:No assets to write. INFO:tensorflow:SavedModel written to: logs/simple_save/saved_model.pb

OMP: 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 theprogram. 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/.

[MBP:05587] *** Process received signal *** [MBP:05587] Signal: Abort trap: 6 (6) [MBP:05587] Signal code: (0) [MBP:05587] [ 0] 0 libsystem_platform.dylib 0x00007fff6ad79b3d _sigtramp + 29 [MBP:05587] [ 1] 0 libiomp5.dylib 0x0000000110b7b018 __kmp_openmp_version + 88572 [MBP:05587] [ 2] 0 libsystem_c.dylib 0x00007fff6ac381c9 abort + 127 [MBP:05587] [ 3] 0 libiomp5.dylib 0x0000000110b24df3 __kmp_abort_process + 35 [MBP:05587] *** End of error message *** Abort trap: 6

The workaround is including:

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

However, is there a more permanent fix? Why might there be multiple instances of OpenMP?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:19 (1 by maintainers)

github_iconTop GitHub Comments

34reactions
christabellacommented, Nov 30, 2018

@ZachariahRosenberg did you try conda install nomkl? It worked for a lot of people from that thread but not for me (neither did I have libiomp clang-omp installed on Brew either), only your workaround helped.

2reactions
emigre459commented, Mar 16, 2019

conda install nomkl did the trick for me as well. When I read about MKL on the Anaconda site though, it sounds really helpful in general for machine learning. Any ideas on how we can avoid disabling it and losing the potential efficiency gains?

Read more comments on GitHub >

github_iconTop Results From Across the Web

python - Error #15: Initializing libiomp5.dylib, but found ...
Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized OMP: Hint: This means that multiple copies of the ...
Read more >
OMP: Error #15: Initializing libiomp5.dylib, but found ... - GitHub
See the error message: "OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized. OMP: Hint: This means that ...
Read more >
Training... OMP: Error #15: Initializing libiomp5.dylib, but found ...
dylib already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program.
Read more >
Getting OMP: Error #15: Initializing libiomp5.so, but found ...
I am running a python script which imports and uses these libraries: pandas, keras, sklearn, numpy, math, matplotlib It throws the following ...
Read more >
Error #15: Initializing libiomp5.dylib, but found ... - YouTube
This video explainsError # 15 : Initializing libiomp5. dylib, but found libiomp5.dylib already initialized--Become part of the top 3% of the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found