1. 程式人生 > >qt配置tensorflow 動態鏈接庫運行錯誤

qt配置tensorflow 動態鏈接庫運行錯誤

src work program term enc home 3.4 包含 proc

使用qt配置自己編譯的tensorflow,在.pro文件下添加如下配置:

INCLUDEPATH += /usr/local/opencv3/include /usr/local/include /home/zy/.cache/bazel/_bazel_zy/69673882bdf22f44b89ee446a9525e4a/external/eigen_archive/Eigen \ #Eigen library;
/home/zy/.cache/bazel/_bazel_zy/69673882bdf22f44b89ee446a9525e4a/external/eigen_archive /home/zy/.cache/bazel/_bazel_zy/69673882bdf22f44b89ee446a9525e4a/external/nsync/public /home/zy/Downloads/tensorflow-1.4.0/bazel-tensorflow-1.4.0 /home/zy/Downloads/tensorflow-1.4.0/bazel-genfiles

LIBS += -L/home/zy/Downloads/tensorflow-1.4.0/bazel-bin/tensorflow -L/usr/local/opencv3/lib/ -L/usr/local/lib /usr/local/lib/libprotobuf.a /home/zy/Downloads/tensorflow-1.4.0/bazel-bin/tensorflow/libtensorflow_cc.so /home/zy/Downloads/tensorflow-1.4.0/bazel-bin/tensorflow/libtensorflow_framework.so /usr/local/opencv3/lib/libopencv_core.so /usr/local/opencv3/lib/libopencv_highgui.so /usr/local/opencv3/lib/libopencv_imgproc.so /usr/local/opencv3/lib/libopencv_imgcodecs.so

運行包含tensorflow頭文件的程序,出現如下錯誤:

[libprotobuf FATAL external/protobuf_archive/src/google/protobuf/stubs/common.cc:79] This program was compiled against version 2.6.1 of the Protocal Buffer runtime library, which is not compatible with the installed version(3.4.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 Protocal Buffers as your link-time library. (Version verification failed in "/build/mir-08_xaj/mir-0.26.3+16.044.20170605/obj-x86_64-linux-gnu/src/protobuf/mir_protobuf.pb.cc".)terminate called after throwing an instance of ‘google::protobuf::FatalException‘ what(): This program was compiled against version 2.6.1 of the Protocal Buffer runtime library, which is not compatible with the installed version (3.4.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 the Protocal Buffers as your link-time library. (Version verification failed in "/build/mir-08_xaj/mir-0.26.3+16.04.20170605/obj-x86_64-linux-gun/src/protobuf/mir_protobuf.pb.cc".)

問題分析

系統的protoc位置在/usr/local/bin, 使用protoc --version輸出的版本號為:libprotoc 3.4.0.

qt配置tensorflow 動態鏈接庫運行錯誤