安装xgboost

linux下安装CPU版本

pip install xgboost一直失败,anaconda默认的gcc的版本是GCC4.4.7(可以通过在终端输入python查看)。而安装xgboost是用的pip install xgboost命令,是系统使用系统默认的GCC编译,系统默认的GCC版本通过 gcc --version 查看是4.8.5  可能两者版本不一致导致的。

解决方法:

先输入命令'conda install libgcc',然后在pip install xgboost,

还可以参考:https://github.com/dmlc/xgboost/issues/1946

还有一个方法时删除anaconda

linux下安装GPU版本

心塞:安装了一下午各种失败

遇到问题

CMake Error at CMakeLists.txt:96 (add_library):
  Cannot find source file:
    rabit/src/allreduce_base.cc 。。。。
    No SOURCES given to target: rabit

升级cmake到3.2

udo apt-get install build-essential //如果系统已安装build-essential则不需要执行此步骤
wget http://www.cmake.org/files/v3.2/cmake-3.2.2.tar.gz
tar xf cmake-3.2.2.tar.gz
cd cmake-3.2.2
./configure
make
需要在config.mk里制定gcc路径
export CC = /usr/local/bin/gcc-7
export CXX = /usr/local/bin/g++-7
cp make/config.mk ./config.mk
make clean_all 

安装xgboost

git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
mkdir build
cd build
cmake .. -DUSE_CUDA=ON
make -j

3. 安装Python包
在xgboost根目录下

cd python-package
sudo python setup.py install

测试GPU加速
python3 tests/benchmark/benchmark.py
 

 其他1

git clone --recursive https://github.com/dmlc/xgboost
mkdir build
cd build
cmake ..  -DUSE_CUDA=ON

(cmake .. -G"Visual Studio 14 2015 Win64" -DUSE_CUDA=ON)

 

其他2windows下

https://www.lfd.uci.edu/~gohlke/pythonlibs/#xgboost

下载对应版本

  • xgboost‑0.90‑cp36‑cp36m‑win_amd64.whl

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值