zoukankan      html  css  js  c++  java
  • ubuntu 18 安装xgboost GPU版本

    综合上述两个帖子:

    https://www.cnblogs.com/huadongw/p/6161145.html

    https://blog.csdn.net/u011587516/article/details/78995186

    先把之前安装的xgboost都卸载干净:

    pip uninstall xgboost

    确保电脑里安装了cuda。

    然后按照下面的步骤来安装GPU版本的xgboost:

    $git clone --recursive https://github.com/dmlc/xgboost
    $cd xgboost
    $mkdir build
    $cd build
    $cmake .. -DUSE_CUDA=ON
    $make -j
    $sh build.sh
    $cd python-package
    $python setup.py install
     
    测试GPU
    testsenchmark目录下

    分别执行

    python benchmark.py --tree_method gpu_hist
    python benchmark.py --tree_method hist
    可以看到,第一个gpu版本的比第二个非GPU版本的快。在实际的代码中,只要在添加下面的参数就行了
    param['tree_method'] = 'gpu_hist'

     
  • 相关阅读:
    java配置环境变量
    What Beautiful HTML Code Looks Like jessica
    Hive 快速搭建
    Apq本地工具集
    SQL:查询购买了所有指定商品的人
    NodeJs
    留存
    markdown
    微信公众号开发
    viper
  • 原文地址:https://www.cnblogs.com/zhoubiyu/p/10425759.html
Copyright © 2011-2022 走看看