Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python Rapids CUML随机森林回归模型推断_Python_Machine Learning_Random Forest_Machine Learning Model_Rapids - Fatal编程技术网

Python Rapids CUML随机森林回归模型推断

Python Rapids CUML随机森林回归模型推断,python,machine-learning,random-forest,machine-learning-model,rapids,Python,Machine Learning,Random Forest,Machine Learning Model,Rapids,我正在使用Google Colab上CUML 0.10.0库中的随机森林回归模型,在获得模型预测时遇到了困难。模型训练成功结束后,我将使用(.predict)方法对一个非常大的数组(41697600,11)进行推理。但是,我收到以下错误: TypeError: GPU predict model only accepts float32 dtype as input, convert the data to float32 or use the CPU predict with `predict

我正在使用Google Colab上CUML 0.10.0库中的随机森林回归模型,在获得模型预测时遇到了困难。模型训练成功结束后,我将使用(.predict)方法对一个非常大的数组(41697600,11)进行推理。但是,我收到以下错误:

TypeError: GPU predict model only accepts float32 dtype as input, convert the data to float32 or use the CPU predict with `predict_model='CPU'`.
即使将输入numpy数组的dtype强制转换为float32并在predict方法中指定predict_model='CPU'参数,错误仍然存在

这是用于参考的代码:

array=(X_test.values).astype('float32')
predictions = cuml_model.predict(array, predict_model='CPU',output_class=False, algo='BATCH_TREE_REORG')
模型摘要:

<bound method RandomForestRegressor.print_summary of RandomForestRegressor(n_estimators=10, max_depth=16, handle=<cuml.common.handle.Handle object at 0x7fbfa342e888>, max_features='auto', n_bins=8, n_streams=8, split_algo=1, split_criterion=2, bootstrap=True, bootstrap_features=False, verbose=False, min_rows_per_node=2, rows_sample=1.0, max_leaves=-1, accuracy_metric='mse', quantile_per_tree=False, seed=-1)>

此错误消息非常令人困惑。我认为这是失败的,因为训练不是在预测。因此,如果你改为使用float32进行训练,这一切都会起作用。预测的优化GPU实现目前仅支持float32模型。您应该能够退回到缓慢的CPU预测,但此异常正在阻止它


我将此作为一个bug提交,我们将尝试在即将发布的版本中进行修复。请随时关注或添加任何额外的问题等:

非常感谢。事实上,情况就是这样。使用float32数组重新培训后,问题得到解决。