在使用lightgbm训练模型时,遇到了一个错误,提示如下:
ValueError: The `num_actors` 参数设置为0。请始终指定您想要使用的分布式actors的数量。通过将 `RayParams(num_actors=X)` 参数传递给您的 lightgbm_ray 调用来解决此问题。
安装过程:
!pip install ludwig[tree,distributed]==0.8.2
完整的错误信息在 txt 文件中,如下所示:
[light_gbm_error.txt](https://github.com/ludwig-ai/ludwig/files/13596041/light_gbm_error.txt)
在本地环境下可以正常训练模型,但在ray集群上出现上述错误。以下是用于训练的模型配置文件:
{
"dl_config": {
"input_features": [
{ "name": "I1", "type": "number"},
{ "name": "I2", "type": "number"},
{ "name": "I3", "type": "number"},
{ "name": "C1", "type": "category"},
{ "name": "C2", "type": "category"},
{ "name": "C3", "type": "category"},
{ "name": "C4", "type": "category"},
{ "name": "C5", "type": "category"}
],
"output_features": [
{ "name": "Label",
"type": "binary"
}
],
"model_type": "gbm",
"trainer" : {
"num_boost_round": 150,
"early_stop": 30,
"learning_rate": 0.001,
"boosting_type": "gbdt",
"num_leaves": 82
}
}
}
2条答案
按热度按时间sirbozc51#
我们可以在设置中添加 "num_workers": 2,如下所示。
67up9zun2#
你好,@rishabr-aizencorp!感谢你标记问题并提供requirements.txt文件。它似乎很奇怪,因为:
我认为我们需要几天时间来重现这个问题,然后回来提供解决方案。