Skip to content
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

Kernel dying mac os Mojave 10.14 #1976

Closed
efago opened this issue Jan 28, 2019 · 8 comments
Closed

Kernel dying mac os Mojave 10.14 #1976

efago opened this issue Jan 28, 2019 · 8 comments

Comments

@efago
Copy link

efago commented Jan 28, 2019

After grappling with installation of LightGBM, which I couldn't get an easy installation with anaconda, I couldn't run lightgbm on jupyter because it is crashing instantly. Please give me your feedback, I am stuck. :(

Environment info

Operating System: Mac Mojave 14

CPU/GPU model: 16 GB 2400 MHz DDR4, 2.2 GHz Intel Core i7

C++/Python/R version: python 3.7

LightGBM version or commit hash: 2.2

Error message

The kernel appears to have died. It will restart automatically.

Reproducible examples

Steps to reproduce

param = {'num_leaves': 111,
'min_data_in_leaf': 149,
'objective':'regression',
'max_depth': 9,
'learning_rate': 0.005,
"boosting": "gbdt",
"feature_fraction": 0.7522,
"bagging_freq": 1,
"bagging_fraction": 0.7083 ,
"bagging_seed": 11,
"metric": 'rmse',
"lambda_l1": 0.2634,
"random_state": 133,
"verbosity": -1}
folds = KFold(n_splits=5, shuffle=True, random_state=15)
oof = np.zeros(len(train))

for fold_, (trn_idx, val_idx) in enumerate(folds.split(train.values, target.values)):
train_mat = lgb.Dataset(train.iloc[trn_idx][features],
label=target.iloc[trn_idx],
)
val_mat = lgb.Dataset(train.iloc[val_idx][features],
label=target.iloc[val_idx],
categorical_feature=categorical_feats
)

num_round = 10000
clf = lgb.train(param,
                trn_data,
                num_round,
                valid_sets = [train_mat, val_mat],
                verbose_eval=100,
                early_stopping_rounds = 200)

oof[val_idx] = clf.predict(train.iloc[val_idx][features], num_iteration=clf.best_iteration)

feature_importance = clf.feature_importance()
@drabrucelee
Copy link

I am also stuck at that point using the predict, hopping for feedback!

@efago
Copy link
Author

efago commented Jan 30, 2019

I hope someone with a better knowledge would help.

@StrikerRUS
Copy link
Collaborator

StrikerRUS commented Jan 30, 2019

@efago @drabrucelee What about simple python command? Does it crashes too?

Please post a log from the Jupyter console. You haven't share a MCVE, so without any logs it's hard to say what's going wrong here.

@efago
Copy link
Author

efago commented Jan 30, 2019

@StrikerRUS thanks for your reply here's the log:
[I 22:26:42.885 NotebookApp] Starting buffering for f1001099-4595-4b6d-89ec-e3347aa5fc23:6033709f02634fb0a31115fc5f8011d4
[I 22:26:43.321 NotebookApp] Adapting to protocol v5.1 for kernel f1001099-4595-4b6d-89ec-e3347aa5fc23
OMP: Error #15: Initializing libomp.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://openmp.llvm.org/

@efago
Copy link
Author

efago commented Jan 30, 2019

@StrikerRUS I have fixed the problem. During the installation of lightgbm, I was having problems and I installed and uninstalled lightgbm a couple of times without taking care of openmp. So I ended up with multiple openmp packages in my system and it was the cause of the crash. Thanks for your help.

@StrikerRUS
Copy link
Collaborator

@efago Glad that you've solved your problem!

We have a workaround for this OpenMP issue in case of conda + Homebrew in our FAQ: https://lightgbm.readthedocs.io/en/latest/FAQ.html#lightgbm - Question 10.

@drabrucelee
Copy link

drabrucelee commented Jan 30, 2019

Thanks a lot, the problem is solved.

@deepdalytics
Copy link

@efago I seem to have the same problem. How did you remove the additional openmp packages/clean up afterwards? Thank you

@lock lock bot locked as resolved and limited conversation to collaborators Mar 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants