使用GPU尝试LightGBM时出现错误:LightGBMError: 未找到OpenCL设备

我在AWS实例上尝试使用Python运行LightGBM。我可以使用标准的LightGBM进行训练,但如果我使用GPU加速时,会显示以下错误

LightGBMError                             Traceback (most recent call last)<ipython-input-28-758038d46621> in <module>()----> 1 train_blend_x_lgb, test_blend_x_lgb, blend_scores_lgb = lgb_rgr_stack(lgb_params, train_x, y, test_x, 5, early_stopping_rounds=0, missing=None)      2 train_blend_x_lgb.tofile('train_blend_x_lgb_v2.dat')      3 test_blend_x_lgb.tofile('test_blend_x_lgb_v2.dat')<ipython-input-16-ba585885e839> in lgb_rgr_stack(rgr_params, train_x, train_y, test_x, kfolds, early_stopping_rounds, missing)     25                                                 feature_name=full_vars,     26                                                 categorical_feature = dense_cat_vars),---> 27                                   num_boost_round=num_boost_round     28                                 )     29                 val_y_predict_fold = model.predict(val_x_fold)~/anaconda3/lib/python3.6/site-packages/lightgbm/engine.py in train(params, train_set, num_boost_round, valid_sets, valid_names, fobj, feval, init_model, feature_name, categorical_feature, early_stopping_rounds, evals_result, verbose_eval, learning_rates, keep_training_booster, callbacks)    181     # construct booster    182     try:--> 183         booster = Booster(params=params, train_set=train_set)    184         if is_valid_contain_train:    185             booster.set_train_data_name(train_data_name)~/anaconda3/lib/python3.6/site-packages/lightgbm/basic.py in __init__(self, params, train_set, model_file, silent)   1307                 train_set.construct().handle,   1308                 c_str(params_str),-> 1309                 ctypes.byref(self.handle)))   1310             # save reference to data   1311             self.train_set = train_set~/anaconda3/lib/python3.6/site-packages/lightgbm/basic.py in _safe_call(ret)     47     """     48     if ret != 0:---> 49         raise LightGBMError(decode_string(_LIB.LGBM_GetLastError()))     50      51 LightGBMError: No OpenCL device found

回答:

您是否已经为您的EC2实例添加了GPU?默认情况下,EC2实例是不带GPU的。GPU的成本较高。添加一个GPU试试看是否能解决这个问题。

https://aws.amazon.com/ec2/elastic-gpus/

Related Posts

使用LSTM在Python中预测未来值

这段代码可以预测指定股票的当前日期之前的值,但不能预测…

如何在gensim的word2vec模型中查找双词组的相似性

我有一个word2vec模型,假设我使用的是googl…

dask_xgboost.predict 可以工作但无法显示 – 数据必须是一维的

我试图使用 XGBoost 创建模型。 看起来我成功地…

ML Tuning – Cross Validation in Spark

我在https://spark.apache.org/…

如何在React JS中使用fetch从REST API获取预测

我正在开发一个应用程序,其中Flask REST AP…

如何分析ML.NET中多类分类预测得分数组?

我在ML.NET中创建了一个多类分类项目。该项目可以对…

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注