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

Running NN: Error #15: Initializing libomp.dylib, but found libomp.dylib already initialized. #21

Closed
denvercal1234GitHub opened this issue Apr 19, 2023 · 1 comment

Comments

@denvercal1234GitHub
Copy link

denvercal1234GitHub commented Apr 19, 2023

Hi there,

Thanks for the tool.

Every thing was okay, but today, when I ran the code again, it threw me the errors below.

Have you encountered these before?

Thank you for your help!

Fitting regression models
	Randomly selecting 50% of the subsetted input files to fit models
	Fitting...
		XGBoost

  |++++++++++++++++++++++++++++++++++++++++++++++++++| 100% elapsed=23s  
	23.47539 seconds
		NN

  |                                                  | 0 % ~calculating  OMP: Error #15: Initializing libomp.dylib, but found libomp.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/

I tried to delete the /Users/clusteredatom/miniforge3/envs/tensorflowc/lib/libomp.dylib as suggested here (dmlc/xgboost#1715), but then, it caused another error Error in checkForRemoteErrors(val) : 7 nodes produced errors; first error: The h5py Python package is required to save and load models

At the beginning, I activate a conda environment first, then in RStudio, I ran:

library(reticulate)
library(keras)
library(tensorflow)

reticulate::use_python("/Users/clusteredatom/miniforge3/envs/tensorflowc/bin/python3.10")
reticulate::use_condaenv("/Users/clusteredatom/miniforge3/envs/tensorflowc")

#reticulate::use_virtualenv("/Users/clusteredatom/miniforge3/envs/tensorflowc")

reticulate::py_config()

The output is below, so I am not sure why it cannot find the h5py module. Is it because h5py is not installed for every node? But I am running it on my local macbook m1.

python:         /Users/clusteredatom/miniforge3/envs/tensorflowc/bin/python3.10
libpython:      /Users/clusteredatom/miniforge3/envs/tensorflowc/lib/libpython3.10.dylib
pythonhome:     /Users/clusteredatom/miniforge3/envs/tensorflowc:/Users/clusteredatom/miniforge3/envs/tensorflowc
version:        3.10.10 | packaged by conda-forge | (main, Mar 24 2023, 20:12:31) [Clang 14.0.6 ]
numpy:          /Users/clusteredatom/miniforge3/envs/tensorflowc/lib/python3.10/site-packages/numpy
numpy_version:  1.23.2
tensorflow:     /Users/clusteredatom/miniforge3/envs/tensorflowc/lib/python3.10/site-packages/tensorflow

NOTE: Python version was forced by RETICULATE_PYTHON
@denvercal1234GitHub
Copy link
Author

Solved by resetting the laptop -- Not ideal but it worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant