在我尝试导入 cuml 库之前,我已经在 Colab 中安装了 RAPIDS,没有任何问题。幸运的是,我有 Tesla 4 作为 GPU。
这就是我安装 RAPIDS 的方式
# clone RAPIDS AI rapidsai-csp-utils scripts repo
>> !git clone https://github.com/rapidsai/rapidsai-csp-utils.git
# install RAPIDS
>> !bash rapidsai-csp-utils/colab/rapids-colab.sh
>> import sys, os
# set necessary environment variables
>> dist_package_index = sys.path.index('/usr/local/lib/python3.6/dist-packages')
>> sys.path = sys.path[:dist_package_index] + ['/usr/local/lib/python3.6/site-packages']+sys.path[dist_package_index:]
>> sys.path
# update pyarrow & modules
>> exec(open('rapidsai-csp-utils/colab/update_modules.py').read(), globals())
Enjoy using RAPIDS!
RAPIDS Version to install is 0.11
Checking for GPU type:
***********************************************************************
Woo! Your instance has the right kind of GPU, a 'Tesla T4'!
***********************************************************************
************************************************
Your Google Colab instance has RAPIDS installed!
************************************************
***********************************************************************
Let us check on those pyarrow and cffi versions...
***********************************************************************
You're running pyarrow 0.15.0 and are good to go!
unloaded cffi 1.11.5
loaded cffi 1.11.5
当我尝试导入时:
>> import cuml
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-31-a450aff8eac6> in <module>()
----> 1 import cuml
5 frames
/usr/local/lib/python3.6/site-packages/cudf/core/dataframe.py in <module>()
22
23 import cudf
---> 24 import cudf._lib as libcudf
25 import cudf._libxx as libcudfxx
26 from cudf._libxx.null_mask import MaskState, create_null_mask
AttributeError: module 'cudf' has no attribute '_lib'
我也放了这个:
>> ! conda list | grep cudf
>> ! conda list | grep cuml
>> ! conda list | grep cugraph
>> ! conda list | grep numpy
>> ! conda list | grep pandas
cudf 0.13.0 py36_0 rapidsai/label/main
dask-cudf 0.13.0 py36_0 rapidsai/label/main
libcudf 0.13.0 cuda10.0_0 rapidsai/label/main
cuml 0.13.0 cuda10.0_py36_0 rapidsai/label/main
libcuml 0.13.0 cuda10.0_0 rapidsai/label/main
libcumlprims 0.13.0 cuda10.0_0 nvidia
cugraph 0.13.0 py36_0 rapidsai/label/main
libcugraph 0.13.0 cuda10.0_0 rapidsai/label/main
numpy 1.17.5 py36h95a1406_0 conda-forge
pandas 0.25.3 py36hb3f55d8_0 conda-forge
这是我的问题,我正在尝试使用 RAPIDS 使用他的 T-SNE,它比 Scipy T-SNE 更快。