gpt4 book ai didi

machine-learning - 尽管已编译为 GPU 运行,但通过 Scikit learn API 的 XGB 似乎并未在 GPU 中运行

转载 作者:行者123 更新时间:2023-11-30 08:27:43 24 4
gpt4 key购买 nike

虽然 XGB 被编译为在 GPU 上运行,但当通过 Scikit learn API 调用/执行时,它似乎并未在 GPU 上运行。

请告知这是否是预期行为

最佳答案

据我所知,Scikit learn API 目前不支持 GPU。您需要使用学习 API(例如 xgboost.train(...))。这还要求您首先将数据转换为 xgboost DMatrix。

示例:

params = {"updater":"grow_gpu"}
train = xgboost.DMatrix(x_train, label=y_train)
clf = xgboost.train(params, train, num_boost_round=10)

更新:

Scikit Learn API 现在通过 **kwargs 参数支持 GPU: http://xgboost.readthedocs.io/en/latest/python/python_api.html#id1

关于machine-learning - 尽管已编译为 GPU 运行,但通过 Scikit learn API 的 XGB 似乎并未在 GPU 中运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43949476/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com