微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

使用 tensorflow_cc.so

如何解决使用 tensorflow_cc.so

我正在将 Tensorflow2 共享库 (*.so) 文件链接到我的 C++ 程序中。 libtensorflow_cc 和 libtensorflow_framework.so 使用 bazel-3.7.2 和 gcc7.3,并链接我有libmyproj.so”的另一个库。我想将此 libmyproj.so 链接到使用相同 gcc7.3 构建的主程序。我曾尝试使用 -D_GLIBCXX_USE_CXX11_ABI=0 标志来实现 ABI 兼容性(来自 https://www.tensorflow.org/install/sourceConverting std::__cxx11::string to std::string),但没有成功。我陷入了以下错误

undefined reference to ml_model::ml_model(std::__cxx11::basic_string<char,std::char_traits<char>,std::allocator<char> >)' undefined reference to ml_model::preprocess_data(std::__cxx11::basic_string<char,std::allocator<char> >,std::vector<float,std::allocator<float> >,int&,std::vector<int,std::allocator<int> >&)' undefined reference to ml_model::get_predictions(std::__cxx11::basic_string<char,std::vector<std::pair<int,int>,std::allocator<std::pair<int,int> > int,std::allocator<int> >)'函数 std::__cxx11::basic_string* tensorflow::internal::MakeCheckOpString(long const&,int const&,char const*)': undefined reference to tensorflow::internal::CheckOpMessageBuilder::NewString[abi:cxx11]()'

关于为什么会发生这种情况的任何建议?

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。