【问题标题】:How to run a prediction on GPU?如何在 GPU 上运行预测?
【发布时间】:2018-11-21 10:20:07
【问题描述】:

我使用的是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 上运行?

【问题讨论】:

    标签: h2o gpu h2o4gpu


    【解决方案1】:

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

    【讨论】:

    • 我有一个非常大的数据集,大约 10TB,而且数据不是固定的,并且一直在增加(因为它是流数据)。那么,对于这么大的数据集,CPU 是如何预测的呢?
    猜你喜欢
    • 2021-04-21
    • 1970-01-01
    • 1970-01-01
    • 2016-02-04
    • 2021-04-06
    • 1970-01-01
    • 2019-10-06
    • 2017-07-27
    • 1970-01-01
    相关资源
    最近更新 更多