Python CUML fit函数抛出cp.full TypeError

Python CUML fit函数抛出cp.full TypeError,python,google-colaboratory,rapids,Python,Google Colaboratory,Rapids,我一直在尝试在Google Colab pro上运行RAPIDS,并成功安装了cuml和cudf软件包,但我甚至无法运行示例脚本 太长,读不下去了 每当我尝试在Google Colab上运行cuml的fit函数时,我都会遇到以下错误。我在安装和cuml中使用演示示例时都会遇到这种情况。在一系列cuml示例中都会出现这种情况(我第一次尝试运行UMAP时遇到这种情况) 然后我尝试从cuML()运行下面的示例 这将导致问题开始时出现错误。Colab保留cupy==7.4.0,尽管conda在RAPID

我一直在尝试在Google Colab pro上运行RAPIDS,并成功安装了cuml和cudf软件包,但我甚至无法运行示例脚本

太长,读不下去了 每当我尝试在Google Colab上运行cuml的fit函数时,我都会遇到以下错误。我在安装和cuml中使用演示示例时都会遇到这种情况。在一系列cuml示例中都会出现这种情况(我第一次尝试运行UMAP时遇到这种情况)

然后我尝试从cuML()运行下面的示例


这将导致问题开始时出现错误。

Colab保留
cupy==7.4.0
,尽管conda在RAPIDS安装期间安装
cupy==8.6.0
。这是一个自定义安装。在安装RAPIDS之前,我刚刚成功安装了pip
cupy-cuda110==8.6.0
,并且

!pip安装cupy-cuda110==8.6.0

我将很快更新脚本,这样您就不必手动执行,但需要测试更多的内容。再次感谢您让我们知道


编辑:脚本已更新。

这可能很有用:查看此脚本。似乎Colab并没有导入新安装的8.6.0版本的cupy,而是导入旧版本的7.4.8。我有一个补丁,但它引入了一个后续问题。Dx正在运行。请继续收看!谢谢-非常感谢Glen,如果可以的话,现在请使用Colab中的0.18。在我们解决这个问题的时候,这应该对你有用!bash rapidsai csp utils/colab/rapids-colab.sh 0.18刚刚尝试过这个,使用上面的脚本替换
!bash rapidsai csp utils/colab/rapids-colab.sh稳定
!bash rapidsai csp utils/colab/rapids-colab.sh 0.18
这导致了相同的错误,现在使用0.19进行测试-可能安装脚本的其余部分存在问题?工作非常顺利-谢谢。
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-3-c06fc2c31ca3> in <module>()
     13 knn.fit(X_train, y_train)
     14 
---> 15 knn.predict(X_test)

5 frames
cuml/neighbors/kneighbors_regressor.pyx in cuml.neighbors.kneighbors_regressor.KNeighborsRegressor.predict()

cuml/neighbors/nearest_neighbors.pyx in cuml.neighbors.nearest_neighbors.NearestNeighbors.kneighbors()

cuml/neighbors/nearest_neighbors.pyx in cuml.neighbors.nearest_neighbors.NearestNeighbors._kneighbors()

cuml/neighbors/nearest_neighbors.pyx in cuml.neighbors.nearest_neighbors.NearestNeighbors._kneighbors_dense()

/usr/local/lib/python3.7/site-packages/cuml/common/array.py in full(cls, shape, value, dtype, order)
    326         """
    327 
--> 328         return CumlArray(cp.full(shape, value, dtype, order))
    329 
    330     @classmethod

TypeError: full() takes from 2 to 3 positional arguments but 4 were given
# Install RAPIDS
!git clone https://github.com/rapidsai/rapidsai-csp-utils.git
!bash rapidsai-csp-utils/colab/rapids-colab.sh stable

import sys, os, shutil

sys.path.append('/usr/local/lib/python3.7/site-packages/')
os.environ['NUMBAPRO_NVVM'] = '/usr/local/cuda/nvvm/lib64/libnvvm.so'
os.environ['NUMBAPRO_LIBDEVICE'] = '/usr/local/cuda/nvvm/libdevice/'
os.environ["CONDA_PREFIX"] = "/usr/local"
for so in ['cudf', 'rmm', 'nccl', 'cuml', 'cugraph', 'xgboost', 'cuspatial']:
  fn = 'lib'+so+'.so'
  source_fn = '/usr/local/lib/'+fn
  dest_fn = '/usr/lib/'+fn
  if os.path.exists(source_fn):
    print(f'Copying {source_fn} to {dest_fn}')
    shutil.copyfile(source_fn, dest_fn)
# fix for BlazingSQL import issue
# ImportError: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by /usr/local/lib/python3.7/site-packages/../../libblazingsql-engine.so)
if not os.path.exists('/usr/lib64'):
    os.makedirs('/usr/lib64')
for so_file in os.listdir('/usr/local/lib'):
  if 'libstdc' in so_file:
    shutil.copyfile('/usr/local/lib/'+so_file, '/usr/lib64/'+so_file)
    shutil.copyfile('/usr/local/lib/'+so_file, '/usr/lib/x86_64-linux-gnu/'+so_file)
from cuml.neighbors import KNeighborsRegressor

from sklearn.datasets import make_blobs
from sklearn.model_selection import train_test_split

X, y = make_blobs(n_samples=100, centers=5,
                  n_features=10)

knn = KNeighborsRegressor(n_neighbors=10)

X_train, X_test, y_train, y_test = train_test_split(X, y, train_size=0.80)

knn.fit(X_train, y_train)

knn.predict(X_test)