Error importing Python LightGBM

I installed lightGBM as described here on Linux:

https://github.com/Microsoft/LightGBM/wiki/Installation-Guide#linux-2

I can successfully run GPU (and CPU) training using the CLI: https://github.com/Microsoft/LightGBM/blob/master/docs/GPU-Tutorial.md#run-your-first-learning-task-on- gpu

However, when I try to import a python package (python 3.6), I get the following error:

OSError: /home/anaconda3/lib/python3.6/site-packages/lightgbm-0.2-py3.6.egg/lightgbm/lib_lightgbm.so: symbol clCreateCommandQueueWithProperties, version OPENCL_2.0 not defined in file libOpenCL.so.1 with link time reference

I am new to understanding links and other things that can be a problem. Anyone who can offer some simple recommendations?

+4
source share
1 answer

LGBM python, python CLI. , - this. CLI. GBMClassifier/Regressor, exec_path. .

, , : `

import numpy as np
from sklearn import datasets, metrics, model_selection
from pylightgbm.models import GBMClassifier
exec = "~/Documents/apps/LightGBM/lightgbm"
X, Y = datasets.make_classification(n_samples=200, n_features=10)
x_train, x_test, y_train, y_test = model_selection.train_test_split(X, Y, test_size=0.2)
clf = GBMClassifier(exec_path=exec, min_data_in_leaf=1)
clf.fit(x_train, y_train, test_data=[(x_test, y_test)])
y_pred = clf.predict(x_test)
print("Accuracy: ", metrics.accuracy_score(y_test, y_pred))

`

0

Source: https://habr.com/ru/post/1677646/


All Articles