简体   繁体   English

我想使用Tensorflow C ++ API,但是从源代码构建Tensorflow之后,应该如何在Xcode中链接库?

[英]I want to use Tensorflow C++ API, but after I build Tensorflow from source, how should I link libraries in Xcode?

I downloaded the source code of tensorflow from github, then I configured it and run bazel build //tensorflow:libtensorflow_cc.so . 我从github下载了tensorflow的源代码,然后对其进行配置并运行bazel build //tensorflow:libtensorflow_cc.so Then how should I link the header files or flags of it. 那么我应该如何链接头文件或它的标志。 Then I can use Xcode to run my tensorflow code and don't need to use Bazel every time to run my code? 然后我可以使用Xcode运行我的张量流代码,而不必每次都使用Bazel运行我的代码?

I hope you have already found a solution but if not, maybe this will help. 我希望您已经找到了解决方案,但是如果没有,也许这会有所帮助。

I recently used the information in this article: 我最近使用了本文中的信息:

http://tuatini.me/building-tensorflow-as-a-standalone-project/ http://tuatini.me/building-tensorflow-as-a-standalone-project/

in order to get all the correct pre-requisite modules, produce the required TensorFlow library files and gather together the header files needed to be able to compile Qt C++ project written against the TensorFlow C++ API - no need use Bazel as part of build process for my Qt project and my Qt project source code is completely separate from the TensorFlow source code structure. 为了获取所有正确的必备模块,生成所需的TensorFlow库文件并将所需的头文件收集在一起,以便能够编译针对TensorFlow C ++ API编写的Qt C ++项目-无需将Bazel用作构建过程的一部分我的Qt项目和我的Qt项目源代码与TensorFlow源代码结构完全分开。

If you follow the article and still have an issue with a missing nsync header file, search the comments at the bottom of the page for where to copy the nsync header files from. 如果您遵循本文,但仍然缺少nsync标头文件,请在页面底部的注释中搜索从中复制nsync标头文件的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Tensorflow的C ++ API中,如何使用Eigen Tensor设置Tensorflow Tensor? - In Tensorflow's C++ API, how do I use an Eigen Tensor to set my Tensorflow Tensor? 如何仅从源代码构建 TensorFlow lite 而不是所有 TensorFlow? - How can I build only TensorFlow lite and not all TensorFlow from source? 我应该使用哪些库来处理C ++中的存档? - What libraries should I use to manipulate archives from C++? 如何使用Tensorflow c ++来实现此代码(FaceNet)? - How do I use Tensorflow c++ to implement this code (FaceNet)? 我如何在TensorFlow C ++ API中使用fileWrite摘要在Tensorboard中查看它 - How I can use fileWrite summary in tensorFlow C++ API to view it in Tensorboard 如何链接和使用 Objective-C Xcode 项目中的 LLVM 库? - How do I link and use LLVM libraries from an Objective-C Xcode project? 如何构建和使用 Google TensorFlow C++ api - How to build and use Google TensorFlow C++ api 如何从 C++ 中的 tensorflow 变量中获取数据 - How can I obtain the data from a tensorflow Variable in C++ 我应该按什么顺序来构建C ++静态库 - What order should I build my C++ static libraries 如何将要在C ++中使用的C库的库路径添加到环境中 - How do I add library paths of C libraries that I want to use in C++ to the environment
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM