h2o - 如何在 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 上运行?
解决方案
预测旨在在 CPU 上运行,因此您不需要 GPU 即可实际使用该模型。
推荐阅读
- spring-integration - 自动将错误从 errorChannel 发布到特定目的地
- ruby-on-rails - Rails 控制台通过网页界面访问?
- regex - MAX 值的 ARRAYFORMULA 不适用于 N/A 输入
- express - 需要我的服务器返回包含数据错误的响应。需要客户查看请求中的数据有什么问题
- go - How to use github.com/jhump/protoreflect to parse a byte array of proto message knowing the message descriptor
- pepper - Load Url on Pepper's Tablet
- python - 需要帮助找出为什么我的 csv 输出为空白?
- c++ - C++中的多线程TCP服务器
- rgb - 如何找到最频繁的整数三元组?
- testing - 如何获取 testCafe 退出代码