繁体   English   中英

将 cuML 安装到 Colab 或 Kaggle 笔记本中

[英]Installing cuML into Colab or Kaggle notebook

我想使用这个!pip install cuml cuml package 。 虽然,这以前有效。 但是,它现在不工作并给了我以下输出:


Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting cuml
  Downloading cuml-0.6.1.post1.tar.gz (1.1 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: cuml
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for cuml (setup.py) ... error
  ERROR: Failed building wheel for cuml
  Running setup.py clean for cuml
Failed to build cuml
Installing collected packages: cuml
  error: subprocess-exited-with-error
  
  × Running setup.py install for cuml did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Running setup.py install for cuml ... error
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cuml

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

我使用这些命令来安装 package,但是当我导入 package 时,出现以下错误:

命令

!pip install cupy-cuda11x
!pip install cuml-cu11 --extra-index-url=https://pypi.ngc.nvidia.com

产出

/usr/local/lib/python3.8/site-packages/cudf/utils/gpu_utils.py:148: UserWarning: No NVIDIA GPU detected
  warnings.warn("No NVIDIA GPU detected")
---------------------------------------------------------------------------
CUDARuntimeError                          Traceback (most recent call last)
<ipython-input-1-95aa20f405cb> in <module>
     11 from sklearn import preprocessing, metrics
     12 from sklearn.model_selection import train_test_split, GridSearchCV
---> 13 from cuml.svm import SVR
     14 
     15 #from hummingbird.ml import convert,load

10 frames
kernel_shap.pyx in init cuml.explainer.kernel_shap()

elastic_net.pyx in init cuml.linear_model.elastic_net()

qn.pyx in init cuml.solvers.qn()

hinge_loss.pyx in init cuml.metrics.hinge_loss()

cuda.pyx in cuml.common.cuda.has_cuda_gpu()

/usr/local/lib/python3.8/site-packages/rmm/_cuda/gpu.py in getDeviceCount()
     99     status, count = cudart.cudaGetDeviceCount()
    100     if status != cudart.cudaError_t.cudaSuccess:
--> 101         raise CUDARuntimeError(status)
    102     return count
    103 

CUDARuntimeError: cudaErrorNoDevice: no CUDA-capable device is detected

我得到这些结果是因为我认为我没有在 Colab 上激活 GPU。

要 pip 在 Colab 上安装 RAPIDS cuML,请确保您使用的是 GPU 运行时,然后使用此处注明的 pip 安装命令。 您缺少--extra-index-url选项。

您将无法 pip 在 Kaggle 上安装 cuML,因为 pip 软件包需要 Python 3.8 或 3.9,但 Kaggle 绑定到 Python 3.7(在撰写本文时)。

最近(23 年 5 月)的 Kaggle 图像预装了 cuml

python --version
pip show cuml
Python 3.10.10
Name: cuml
Version: 23.4.1
Summary: cuML - RAPIDS ML Algorithms
Home-page: 
Author: NVIDIA Corporation
Author-email: 
License: Apache 2.0
Location: /opt/conda/lib/python3.10/site-packages
Requires: cudf, cupy-cuda11x, dask, dask-cuda, dask-cudf, distributed, joblib, numba, raft-dask, scipy, seaborn, treelite, treelite_runtime
Required-by: 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM