简体   繁体   English

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

[英]Protobuf compatibility error when running Kedro pipeline

I have a Kedro pipeline that I want to run through a Python script, I think I have the minimum necessary code to do this, but everytime I try to run the pipeline through the script, I get a compatibility error regarding the protobuf version, but when I run the pipeline through the terminal it runs without problems.我有一个想要通过 Python 脚本运行的 Kedro 管道,我认为我有最少的必要代码来执行此操作,但是每次我尝试通过脚本运行管道时,我都会收到关于 protobuf 版本的兼容性错误,但是当我通过终端运行管道时,它运行没有问题。 It is important to say that I am running everything inside a Docker container, and the image is based on PyTorch (version 1.9.0 and cuda 11.1).重要的是要说我在 Docker 容器中运行所有东西,并且图像基于 PyTorch(版本 1.9.0 和 cuda 11.1)。

This is the code I am using to call the pipeline:这是我用来调用管道的代码:

from kedro.framework.context import load_context

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

And here is the error that I get when I run it:这是我运行它时遇到的错误:

[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

I have already tried changing the protobuf version, but I cannot find a compatible one.我已经尝试更改 protobuf 版本,但找不到兼容的版本。 What can I do to solve this problem?我能做些什么来解决这个问题?

I faced a similar problem with kedro.我遇到了与kedro类似的问题。 This helped:这有助于:

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