【发布时间】:2017-09-15 08:44:55
【问题描述】:
我已经通过virtualenv 安装了 TensorFlow。而且效果很好。
现在我想使用 C++ 加载模型并进行预测。但是由于 protobuf 版本不匹配,我无法编译我的程序。像这样的错误:
tensorflow/core/framework/device_attributes.pb.h:17:2: error: #error This file was generated by an older version of protoc which is
#error This file was generated by an older version of protoc which is
^
tensorflow/core/framework/device_attributes.pb.h:18:2: error: #error incompatible with your Protocol Buffer headers. Please
#error incompatible with your Protocol Buffer headers. Please
^
tensorflow/core/framework/device_attributes.pb.h:19:2: error: #error regenerate this file with a newer version of protoc.
#error regenerate this file with a newer version of protoc.
在虚拟环境中:
$ pip show protobuf
Name: protobuf
Version: 3.4.0
Summary: Protocol Buffers
在外壳中:
$ protoc --version
libprotoc 3.4.0
我的环境中曾经有protobuf-2.6.1,但现在升级到3.4.0。
ubuntu 16.04
【问题讨论】:
标签: c++ tensorflow protocol-buffers