使用Opencv和Tensorflow C ++时冲突Protobuf版本 [英] Conflict Protobuf version when using Opencv and Tensorflow c++

查看:742
本文介绍了使用Opencv和Tensorflow C ++时冲突Protobuf版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试在非bazel项目中使用Tensorflow的共享库,所以我使用bazel从tensorflow创建了一个.so文件.

I am currently trying to use Tensorflow's shared library in a non-bazel project, so I creat a .so file from tensorflow using bazel.

但是当我启动同时使用Opencv和Tensorflow的c ++程序时,会出现以下错误:

but when I launch a c++ program that uses both Opencv and Tensorflow, it makes me the following error :

[libprotobuf FATAL external/protobuf/src/google/protobuf/stubs/common.cc:78]该程序是根据协议缓冲区运行时库2.6.1版编译的,该库与已安装的版本(3.1 .0).请与程序作者联系以获取更新.如果您自己编译程序,请确保标头与链接时库来自相同版本的协议缓冲区. ("/build/mir-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc"中的版本验证失败.) 抛出'google :: protobuf :: FatalException'实例后终止终止调用

[libprotobuf FATAL external/protobuf/src/google/protobuf/stubs/common.cc:78] This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.1.0). 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 "/build/mir-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".) terminate called after throwing an instance of 'google::protobuf::FatalException'

what():该程序是根据Protocol Buffer运行时库的2.6.1版编译的,该库与已安装的版本(3.1.0)不兼容.请与程序作者联系以获取更新.如果您自己编译程序,请确保标头与链接时库来自相同版本的协议缓冲区. ("/build/mir-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc"中的版本验证失败.) 放弃(弃用核心)

what(): This program was compiled against version 2.6.1 of the Protocol Buffer runtime library, which is not compatible with the installed version (3.1.0). 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 "/build/mir-pkdHET/mir-0.21.0+16.04.20160330/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".) Abandon (core dumped)

你能帮我吗?

谢谢

推荐答案

该错误表明程序是使用protobuf 2.6.1的标头(.h文件)编译的.这些标头通常在/usr/include/google/protobuf/usr/local/include/google/protobuf中找到,尽管它们可能在其他位置,具体取决于您的操作系统和程序的构建方式.您需要将这些标头更新为版本3.1.0,然后重新编译程序.

The error indicates that the program was complied using headers (.h files) from protobuf 2.6.1. These headers are typically found in /usr/include/google/protobuf or /usr/local/include/google/protobuf, though they could be in other places depending on your OS and how the program is being built. You need to update these headers to version 3.1.0 and recompile the program.

这篇关于使用Opencv和Tensorflow C ++时冲突Protobuf版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆