Closed
Description
xgboost segfaults in combination with scikit-learn==1.0.0 and works fine with scikit-learn==0.24
Steps to reproduce:
- Install
scikit-learn==1.0.0
andxgboost==1.5.0
- Run this simple script
import numpy as np import xgboost x = np.random.random((150, 4)) y = np.random.randint(0, 3, 150) learner = xgboost.XGBClassifier() learner.fit(x, y)
I found out that scikit-learn brings its own version of libomp library together with the package. It is stored in sklearn/.dylibs/libomp.dylib
. When I remove it from sklearn segfault does not happen. When libomp is present in sklearn and I remove a global version from the computer xgboost does not work since it cannot find the library. It shows that xgboost is actually not using the libomp library from scikit-learn but there must be some coincidence.
When downgrading scikit-learn to 0.24 it still ships its own version of libomp but the segfaul does not happen.