ludwig Ray - protobuf问题

um6iljoc  于 2个月前  发布在  其他
关注(0)|答案(5)|浏览(46)

Bug描述

在使用其中一个示例时,我遇到了一个protobuf错误跟踪

重现步骤

(train_stats, preprocessed_data, output_directory) = model.train(
dataset,
model_name="rotten_tomatoes",
output_directory="results_rotten_tomatoes",
)

请提供代码、yaml配置文件和一个样本数据以便完全重现问题。

无法重现的问题将被忽略。

配置文件

input_features:
- name: genres
 type: set
 preprocessing:
 tokenizer: comma
 - name: content_rating
 type: category
 - name: top_critic
 type: binary
 - name: runtime
 type: number
 - name: review_content
 type: text
 encoder:
 type: embed
 output_features:
 - name: recommended
 type: binary

截图

如果适用,请添加截图以帮助解释您的问题。

环境(请填写以下信息):

  • 操作系统:[例如 iOS]

MacOs M1

  • 版本[例如 22]

Ventura 13.3.1

  • Python版本

3.10.11

  • Ludwig版本

ludwig v0.10.1

其他上下文

在此处添加有关问题的任何其他上下文。

jpfvwuh4

jpfvwuh41#

请问您使用的是哪个版本的ray?

u1ehiz5o

u1ehiz5o2#

使用此代码中的默认本地Ray版本:
backend_config = {
"type": "ray",
"processor": {
"parallelism": 6,
"type": "dask",
},
"trainer": {
"use_gpu": False,
"num_workers": 3,
"resources_per_worker": {
"CPU": 2,
"GPU": 0,
},
},
}
backend = initialize_backend(backend_config)

qyswt5oh

qyswt5oh3#

可能需要澄清的问题是:在初始化之前,我是否需要安装一个正在运行的Ray集群?如果是这样,我是否必须使用ludwig github仓库中可用的容器?文档
https://ludwig.ai/latest/user_guide/distributed_training/ 建议我需要安装Ray。顺便说一下-文档中的Ray Launcher链接给出了404错误:https://docs.ray.io/en/latest/cluster/launcher.html

h9a6wy2h

h9a6wy2h4#

你不需要这样做!Ludwig 可以在你的环境中已经初始化的现有 ray 集群上进行连接,否则它会为你初始化一个本地的 ray 集群。
Ray 应该已经被安装为 ludwig[distributed] 的一部分。

8i9zcol2

8i9zcol25#

这个错误是由于protobuf版本不兼容导致的。你需要将protobuf的版本降级到3.20.x或更低版本,或者设置环境变量PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python(但这将使用纯Python解析,速度会慢很多)。

你可以尝试以下方法:

  1. 降级protobuf版本:
pip install protobuf==3.20.0
  1. 设置环境变量:
export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python

更多信息请参考:https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

相关问题