我正在测试基于 protobuf 3.0.0-b3/30.0-b2 的 tensorflow。但是当前的 Ubuntu 16.04 存储库带有 protobuf 2.6.1 ......所以当我测试我的 tensorflow 代码时,我遇到了这个错误消息:
[libprotobuf FATAL google/protobuf/stubs/common.cc:61] This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. 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 "external/protobuf/src/google/protobuf/any.pb.cc".)
terminate called after throwing an instance of 'google::protobuf::FatalException'
what(): This program requires version 3.0.0 of the Protocol Buffer runtime library, but the installed version is 2.6.1. Please update your library. 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 "external/protobuf/src/google/protobuf/any.pb.cc".)
Aborted (core dumped)
Run Code Online (Sandbox Code Playgroud)
我想知道如何解决这个 protobuf 版本冲突问题。
不幸的是,直到 Ubuntu 16.10 (Yakkety Yak) 才可以通过 apt-get 获取 protobuf3 。因此,您要么需要先更新到该版本的 Ubuntu,要么从其 git 存储库获取该库。
按照https://github.com/google/protobuf/blob/master/src/README.md中的说明进行操作,可以从此处安装预构建的https://github.com/google/protobuf/releases或自行构建来源(如果您可能想加入库本身的开发工作)。
小智 2
我不确定这是否是您正在寻找的。我找到了一个非常简单的方法将python 2.7 的protobuf 从 2.6.1 升级到 3.5.2.post1
sudo pip install --upgrade protobuf
如:
在 Ubuntu 15.10 上安装 Google Protobuf
| 归档时间: |
|
| 查看次数: |
21692 次 |
| 最近记录: |