XGBoost with GPU support on Google Colab

我们两清 提交于 2020-12-13 03:04:50

问题


Is there a way to import the XGBoost with GPU support on Google Collab? At last, I tried yesterday and the loaded XGBoost does not have the GPU support.

You could reach the notebook from this link: https://colab.research.google.com/drive/1YxCw7eVHZDrbVBFqSN0-t1mZ-fBJJI7h

And the error is:

XGBoostError: b'[19:15:28] src/learner.cc:151: XGBoost version not compiled with GPU support.\n\nStack trace returned 10 entries:\n[bt] (0) /usr/local/lib/python3.6/dist-packages/xgboost/./lib/libxgboost.so(_ZN4dmlc15LogMessageFatalD1Ev+0x3c) [0x7eff3d42f8ac]\n[bt] (1) /usr/local/lib/python3.6/dist-packages/xgboost/./lib/libxgboost.so(_ZN7xgboost11LearnerImpl17ConfigureUpdatersEv+0x2a1) [0x7eff3d439561]\n[bt] (2) /usr/local/lib/python3.6/dist-packages/xgboost/./lib/libxgboost.so(_ZN7xgboost11LearnerImpl9ConfigureERKSt6vectorISt4pairINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_ESaIS9_EE+0x35b) [0x7eff3d43ba2b]\n[bt] (3) /usr/local/lib/python3.6/dist-packages/xgboost/./lib/libxgboost.so(XGBoosterUpdateOneIter+0x47) [0x7eff3d59cdc7]\n[bt] (4) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c) [0x7eff5dd19e18]\n[bt] (5) /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x32a) [0x7eff5dd1987a]\n[bt] (6) /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x4cd) [0x7eff5df2d96d]\n[bt] (7) /usr/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(+0x8727) [0x7eff5df24727]\n[bt] (8) /usr/bin/python3(_PyObject_FastCallDict+0xa3) [0x459893]\n[bt] (9) /usr/bin/python3() [0x54f117]\n'


回答1:


Download the Linux version from here, and then

!pip uninstall xgboost
!pip install xgboost-0.81-py2.py3-none-manylinux1_x86_64.whl

...is working for me.



来源:https://stackoverflow.com/questions/51760173/xgboost-with-gpu-support-on-google-colab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!