Protobuf 版本不匹配

Ant*_*ato 7 protocol-buffers tensorflow

我目前在 tensorflow 中使用 RNN 收到此错误:

[libprotobuf FATAL google/protobuf/stubs/common.cc:61] 这个程序需要3.3.0版本的Protocol Buffer运行库,但是安装的版本是2.6.1。请更新您的库。如果您自己编译程序,请确保您的头文件来自与链接时库相同版本的 Protocol Buffers。(版本验证在“bazel-out/local_linux-opt/genfiles/tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc”中失败。)在抛出“google::protobuf::FatalException”实例后调用终止

what():这个程序需要3.3.0版的Protocol Buffer运行库,但是安装的版本是2.6.1。请更新您的库。如果您自己编译程序,请确保您的头文件来自与链接时库相同版本的协议缓冲区。(版本验证在“bazel-out/local_linux-opt/genfiles/tensorflow/contrib/tensor_forest/proto/fertile_stats.pb.cc”中失败。)

但是当我检查版本时:

$ pip show protobuf
Name: protobuf
Version: 3.4.0
Summary: Protocol Buffers
Home-page: https://developers.google.com/protocol-buffers/
Author: protobuf@googlegroups.com
Author-email: protobuf@googlegroups.com
License: 3-Clause BSD License
Location: /usr/local/lib/python2.7/dist-packages
Requires: six, setuptools
Run Code Online (Sandbox Code Playgroud)

Fai*_*tar 5

您可能安装了两个不同版本的 protobuf。查看

protoc --version

如果它与 3.4.0 不同。您可能需要卸载它。

  • `protoc` 在我的情况下不存在 (5认同)