使用 libtensorflow_cc.so 使用 Tensorflow C++ API 的头列表 [英] List of headers to use Tensorflow C++ API using libtensorflow_cc.so

查看:32
本文介绍了使用 libtensorflow_cc.so 使用 Tensorflow C++ API 的头列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道要使用 Tensorflow 的 C++ API 需要哪些头文件.就像在 C API 的情况下一样,只有一个头文件 c_api.h 声明了所有功能等,C++ API 是否有这样的单个头文件?我尝试搜索这个,但无法理解什么是必需的,什么不是.

I want to know what all header files are required in order to use Tensorflow's C++ APIs. Like in case of C APIs, there is just a single header c_api.h which has all the functions, etc. declared, is there any such single header for C++ APIs? I tried searching this, but unable to understand what is required and what is not.

在 tensorflow/cc、tensorflow/core 和 tensorflow/c 中有大量头文件用于构建 libtensorflow_cc.so,我们还在 tensorflow 的发行版中提供了大部分头文件(TF 的发行版是指 TF,它是使用 bazel build -c opt --config=cuda//tensorflow/tools/pip_package:build_pip_package 构建.该标题列表是否足以使用 C++ API?或者我们是否需要在 tensorflow/BUILD 中构建任何额外的目标?

There is a huge list of headers in tensorflow/cc, tensorflow/core and tensorflow/c which are used to build libtensorflow_cc.so and we also ship most of these in the tensorflow's distribution (By TF's distribution I mean TF which is built using bazel build -c opt --config=cuda //tensorflow/tools/pip_package:build_pip_package). Is that list of headers sufficient in order to use C++ API? or do we need to build any additional target in tensorflow/BUILD?

我还浏览了https://www.tensorflow.org/api_docs/cc/ 但无法真正确定所需标题的确切列表.

I've also gone through https://www.tensorflow.org/api_docs/cc/ but can't really make out the exact list of required headers.

在其中一篇相关帖子中,我发现 tensorflow/bazel-genfiles 包含所需的标头.请确认这一点.

In one of the related posts, I found that tensorflow/bazel-genfiles contain the required headers. Please confirm this.

提前致谢,西达

推荐答案

对于那些正在使用 bazel 为 windows 构建 tensorflow 2.0 及更高版本 c++ 的人,请使用

for those who are building tensorflow 2.0 and above c++ for windows using bazel, kindly use

bazel build --config=opt tensorflow:install_headers

这将生成一个包含 cc 标题的包含文件夹.

this will generate a include folder with the cc header.

这篇关于使用 libtensorflow_cc.so 使用 Tensorflow C++ API 的头列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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