-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OMP: Error #15: Initializing libiomp5.dylib, but found libiomp5.dylib already initialized. #1715
Comments
I'm having the same issue when I try to use both xgboost and matplotlib. OS X 10.10.5 |
I've encountered the same problem with xgboost and matplotlib. Same symptom...kernel dies with the same error message as reported by @symPhysics Mac OS X 10.12.3 Python 3.5.2 |Anaconda custom (x86_64)| (default, Jul 2 2016, 17:52:12) xgboost 0.6a2 matplotlib 2.0.0 |
FWIW...this seems to be a MacOS specific problem. I was not able to recreate the problem on a CentOS Linux VM. |
At least for Mac,
as long as u got gcc v5 from brew it come with openmp follow steps in: We can close this issue now. |
I tried this and the error stopped ! import os os.environ['KMP_DUPLICATE_LIB_OK']='True' |
For me the issue (on a Mac) was fixed with |
thanks, it works!!! |
I had the same error on my Mac with a python program using numpy, keras, and matplotlib. I solved it with 'conda install nomkl'. |
thanks a lot, it works. |
Thanks too, it works for me too. |
@gpetty You sir are a true hero. Thank you! |
@gpetty It works! THANKSSS :)) |
Strangely
could work |
|
thanks a lot, even though i dont know what is nomkl. It confused me a few days when i run a CNN-RNN model using tensorflow.When i used os.environ['KMP_DUPLICATE_LIB_OK']='True' , it worked, but the program run so slow.You got the right ans. |
My issues were completely unrelated to xgboost, but I got here via google so that I'd share for the sake of others. I am using keras and matplotlib installed via conda. Setting |
For people googling this error, the best solution that I found is listed here. The site lists two method. I prefer method 1, which is to go into your |
Please be really careful if you want to try method 1. Everything crashed after I deleted the file and I have to reinstall openmp. Same problem reported in the original csdn link (in Chinese). |
Thanks!! |
Had the same problem after switching from homebrew/virtualenv installed numpy/keras/matplotlib/tensorflow to miniconda installed. Solved by running |
@sam1902 that worked for me too -- updating the os.environ variable did not. thanks! |
have same issue on my Mac |
Got the same issue on my mac, tried suggested method and it works
|
Thanks so much @gpetty !! You're a life saver! :D |
For me, it works! But the file I removed is a little different from yours which is |
Legend! |
genius level stuff right here |
On Mac M1,
Above didn't fix my issue after update mac os version ❌ these 2 works:
|
This works for my intel-Mac!. Thanks alot! |
Uninstalling and Reinstalling |
it works, thank u |
Thank you so much, it's the only thing that worked for me !! |
Umm, because the
? Actually I ran all those 3 and now nothing works. :) I'm actually trying to run AutoGPT on M1, when all the original libiomp5.dylib problem came up.
|
Try this, I just edited it: #1715 (comment) |
My solution is
It seems to work well! |
I met the same error(not with xgboost though), and I fix it by change import numpy
import torch to import torch
import numpy it seems that import numpy later would solve this problem. But I don't understand why this bug would be fixed in this way . |
it doesnt seem to help macOS |
It work. Thank You. |
[MacOS] |
This worked for me on my M1! |
Have people got problems with this solution?
It is quite explicitly not recommended |
For bugs or installation issues, please provide the following information.
The more information you provide, the more easily we will be able to offer
help and advice.
Environment info
Operating System: Mac OSX Sierra 10.12.1
Compiler:
Package used (python):
xgboost
version used: xgboost 0.6a2If you are using python package, please provide
Pythong 2.7.12
xgboost
if you are not installing from sourcepip install xgboost
Steps to reproduce
import numpy as np
import matplotlib.pyplot as plt
x = np.array([[1,2],[3,4]])
y = np.array([0,1])
clf = XGBClassifier(base_score = 0.005)
clf.fit(x,y)
plt.hist(clf.feature_importances_)
What have you tried?
See the error message:
"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 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/."
I tried:
import os
os.environ['KMP_DUPLICATE_LIB_OK']='True'
It can do the job for me. But it is kind of ugly.
I know it might be not the problem of xgboost, but I'm pretty sure this problem happened after I upgrade xgboost using 'pip install xgboost'. I post the issue here to see if someone had the same problem as me. I have very little knowledge about OpenMP. Please help!
Thanks in advance!
The text was updated successfully, but these errors were encountered: