GPU/TPU 上的 PyCaret 方法

问题描述 投票:0回答:2

当我运行

best_model = compare_models()
时,CPU 内存上有巨大的负载,而我的 GPU 未得到利用。如何在 GPU 上运行
setup()
compare_models()
? PyCaret 中有内置方法吗?

jupyter-notebook gpu cpu kaggle pycaret
2个回答
6
投票

只有部分机型可以在GPU上运行,并且必须正确安装才能使用GPU。例如,对于

xgboost
,您必须使用 pip 安装它并安装 CUDA 10+(或安装来自 anaconda 的 GPU
xgboost
版本等)。以下是可以使用 GPU 的估算器列表及其要求:https://pycaret.readthedocs.io/en/latest/installation.html?highlight=gpu#pycaret-on-gpu

正如Yatin所说,你需要在

use_gpu=True
中使用
setup()
。或者您可以在创建单个模型时指定它,例如
xgboost_gpu = create_model('xgboost', fold=3, tree_method='gpu_hist', gpu_id=0)

对于安装 CUDA,我喜欢使用 Anaconda,因为它很容易,就像

conda install -c anaconda cudatoolkit
。看起来对于非增强方法,您需要安装 cuML 才能使用 GPU。

哦,看起来 pycaret 不能将unet-sklearn与GPU一起使用(在tune_model文档部分底部的警告

这里
)。


2
投票

要在 PyCaret 中使用 GPU,您只需将

use_gpu=True
作为设置函数中的参数即可。 例子:
model = setup(data,target_variable,use_gpu=True)

© www.soinside.com 2019 - 2024. All rights reserved.