如何构建和使用Google TensorFlow C ++ api [英] How to build and use Google TensorFlow C++ api

查看:3160
本文介绍了如何构建和使用Google TensorFlow C ++ api的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的很渴望开始在C ++中使用Google的新Tensorflow库。网站和文档只是真的不清楚如何构建项目的C ++ API,我不知道从哪里开始。

I'm really eager to start using Google's new Tensorflow library in C++. The website and docs are just really unclear in terms of how to build the project's C++ API and I don't know where to start.

有更多经验的人可以通过发现和共享使用tensorflow的C ++ API指南来帮助您吗?

Can someone with more experience help by discovering and sharing a guide to using tensorflow's C++ API?

推荐答案

要开始,您应该从Github下载按照此处的说明(您需要 Bazel 和最新版本的GCC) 。

To get started, you should download the source code from Github, by following the instructions here (you'll need Bazel and a recent version of GCC).

C ++ API(和系统的后端)在 tensorflow / core 中。现在,只有 C ++会话界面 C API 。您可以使用其中任何一个来执行使用Python API构建并序列化到 GraphDef 协议缓冲区的TensorFlow图形。还有一个用于在C ++中构建图形的实验性功能,但是目前还没有像Python API一样全功能(例如目前不支持自动区分)。您可以查看在C ++中构建小图形的示例程序

The C++ API (and the backend of the system) is in tensorflow/core. Right now, only the C++ Session interface, and the C API are being supported. You can use either of these to execute TensorFlow graphs that have been built using the Python API and serialized to a GraphDef protocol buffer. There is also an experimental feature for building graphs in C++, but this is currently not quite as full-featured as the Python API (e.g. no support for auto-differentiation at present). You can see an example program that builds a small graph in C++ here.

C ++ API的第二部分是添加一个新的 OpKernel 的API, CPU和GPU的数值内核的实现。有很多例子如何在 tensorflow / core / kernels 中构建这些实例,以及在C ++中添加新操作的教程

The second part of the C++ API is the API for adding a new OpKernel, which is the class containing implementations of numerical kernels for CPU and GPU. There are numerous examples of how to build these in tensorflow/core/kernels, as well as a tutorial for adding a new op in C++.

这篇关于如何构建和使用Google TensorFlow C ++ api的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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