开发者社区> 知与谁同> 正文
阿里云
为了无法计算的价值
打开APP
阿里云APP内打开

TensorFlow教程之API DOC 6.1.17 TensorFlow C++ Session API reference documentation

简介:
+关注继续查看

本文档为TensorFlow参考文档,本转载已得到TensorFlow中文社区授权。


TensorFlow C++ Session API reference documentation

TensorFlow's public C++ API includes only the API for executing graphs, as of version 0.5. To control the execution of a graph from C++:

  1. Build the computation graph using the Python API.
  2. Use tf.train.write_graph() to write the graph to a file.
  3. Load the graph using the C++ Session API. For example:

    // Reads a model graph definition from disk, and creates a session object you
    // can use to run it.
    Status LoadGraph(string graph_file_name, Session** session) {
     GraphDef graph_def;
     TF_RETURN_IF_ERROR(
         ReadBinaryProto(Env::Default(), graph_file_name, &graph_def));
     TF_RETURN_IF_ERROR(NewSession(SessionOptions(), session));
     TF_RETURN_IF_ERROR((*session)->Create(graph_def));
     return Status::OK();
    }
    
  4. Run the graph with a call to session->Run()

Classes

Structs

版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。

相关文章
三十一、 master: ssh: connect to host master port 22: No route to host
三十一、 master: ssh: connect to host master port 22: No route to host
68 0
SpringMVC - @RequestJson之HandlerMethodArgumentResolver 从入门到青铜(一)
SpringMVC - @RequestJson之HandlerMethodArgumentResolver 从入门到青铜(一)
17 0
SpringMVC - @RequestJson之HandlerMethodArgumentResolver 从入门到青铜(七)
SpringMVC - @RequestJson之HandlerMethodArgumentResolver 从入门到青铜(七)
19 0
SAP ABAP FM AC_DOCUMENT_RECORD 研习
SAP ABAP FM AC_DOCUMENT_RECORD 研习
60 0
pringMVC教程6[Restful和拦截器]
pringMVC教程6[Restful和拦截器]
32 0
TF之DNN:对DNN神经网络进行Tensorboard可视化(得到events.out.tfevents本地服务器输出到网页可视化)
TF之DNN:对DNN神经网络进行Tensorboard可视化(得到events.out.tfevents本地服务器输出到网页可视化)
103 0
SNMP Reflected Denial Of Service - PoC
I am releasing this code due to the fact that my dev server got hacked and people have been using it in the wild for bad things.
739 0
【RAC】Diskgroup shows offline after restart even it is mounted in ASM instance
Diskgroup resource shows status offline after restart even it is mounted in ASM instance Applies to: Oracle Server - Enterprise Edition - Version: 11.
595 0
+关注
10071
文章
2994
问答
文章排行榜
最热
最新
相关电子书
更多
低代码开发师(初级)实战教程
立即下载
阿里巴巴DevOps 最佳实践手册
立即下载
冬季实战营第三期:MySQL数据库进阶实战
立即下载