繁体   English   中英

运行 Kedro 管道时出现 Protobuf 兼容性错误

[英]Protobuf compatibility error when running Kedro pipeline

我有一个想要通过 Python 脚本运行的 Kedro 管道,我认为我有最少的必要代码来执行此操作,但是每次我尝试通过脚本运行管道时,我都会收到关于 protobuf 版本的兼容性错误,但是当我通过终端运行管道时,它运行没有问题。 重要的是要说我在 Docker 容器中运行所有东西,并且图像基于 PyTorch(版本 1.9.0 和 cuda 11.1)。

这是我用来调用管道的代码:

from kedro.framework.context import load_context

class TBE():
  def run_inference():
    context = load_context('./')
    output = context.run(pipeline='inf')
    return output

这是我运行它时遇到的错误:

[libprotobuf FATAL google/protobuf/stubs/common.cc:83] This program was compiled against 
version 3.9.2 of the Protocol Buffer runtime library, which is not compatible with the 
installed version (3.19.4).  Contact the program author for an update.  If you compiled 
the program yourself, make sure that your headers are from the same version of Protocol 
Buffers as your link-time library.  (Version verification failed in "bazel-out/k8- 
opt/bin/tensorflow/core/framework/tensor_shape.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what():  This program was compiled against version 3.9.2 of the Protocol Buffer runtime 
library, which is not compatible with the installed version (3.19.4).  Contact the 
program author for an update.  If you compiled the program yourself, make sure that your 
headers are from the same version of Protocol Buffers as your link-time library.  
(Version verification failed in "bazel-out/k8- 
opt/bin/tensorflow/core/framework/tensor_shape.pb.cc".)
Aborted

我已经尝试更改 protobuf 版本,但找不到兼容的版本。 我能做些什么来解决这个问题?

我遇到了与kedro类似的问题。 这有助于:

pip install --upgrade "protobuf<=3.20.1"

您好,我不完全确定这是否会解决问题 - 但是这里记录了像这样启动 Kedro 运行的正确方法,也许可以解释这种方式与在终端中运行kedro run之间的差异: https:// kedro.readthedocs.io/en/stable/04_kedro_project_setup/03_session.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM