首页 > 解决方案 > 如何在 GPU 上运行预测?

问题描述

我正在使用 h2o4gpu,我设置的参数是

h2o4gpu.solvers.xgboost.RandomForestClassifier model.

XGBClassifier(base_score=0.5, booster='gbtree', colsample_bylevel=1,
colsample_bytree=1.0, gamma=0, learning_rate=0.1, max_delta_step=0,
max_depth=8, min_child_weight=1, missing=nan, n_estimators=100,
n_gpus=1, n_jobs=-1, nthread=None, num_parallel_tree=1, num_round=1,
objective='binary:logistic', predictor='gpu_predictor',
random_state=123, reg_alpha=0, reg_lambda=1, scale_pos_weight=1,
seed=None, silent=False, subsample=1.0, tree_method='gpu_hist')

当我训练这个模型然后进行预测时,一切都在 GPU 上运行良好。

但是,当我将模型保存在 pickle 中,然后加载回另一个笔记本,然后通过 predict_proba 在其上运行预测时,一切都在 CPU 上运行。

为什么我的预测不在 GPU 上运行?

标签: h2ogpuh2o4gpu

解决方案


预测旨在在 CPU 上运行,因此您不需要 GPU 即可实际使用该模型。


推荐阅读