tensorflow 获取所有variable或tensor的name示例

作者:_沥川往事 时间:2021-04-02 22:29:54 

获取所有variable(每个op中可训练的张量)的name:


for variable_name in tf.global_variables():
 print(variable_name)

获取所有tensor(每个op的输出张量)的name:


for tensor_name in tf.contrib.graph_editor.get_tensors(tf.get_default_graph()):
 print(tensor_name)

获取所有op及其输入输出的name:


with tf.Session() as sess:
 for node in sess.graph_def.node:
   print(node)

来源:https://blog.csdn.net/yuejisuo1948/article/details/88858190

标签:tensorflow,variable,tensor,name
0
投稿

猜你喜欢

  • 用Python计算三角函数之atan()方法的使用

    2023-06-22 22:26:00
  • Python3 sys.argv[ ]用法详解

    2021-08-03 00:16:29
  • 使用eval()解析JSON格式字符串应注意的问题

    2008-04-16 15:46:00
  • python实现批量图片格式转换

    2021-07-15 16:07:42
  • pytest官方文档解读fixtures的autouse

    2023-06-22 01:18:58
  • Django模板过滤器和继承示例详解

    2023-10-25 16:52:56
  • Python configparser模块应用过程解析

    2022-08-03 19:56:11
  • 浅谈Python中range和xrange的区别

    2021-04-18 14:52:13
  • asp MYSQL出现问号乱码的解决方法

    2011-04-15 11:13:00
  • Python timer定时器两种常用方法解析

    2023-07-21 19:20:56
  • Linux RedHat下安装Python2.7开发环境

    2021-01-10 17:33:29
  • Python3自定义http/https请求拦截mitmproxy脚本实例

    2021-04-13 15:33:01
  • Python2/3中urllib库的一些常见用法

    2023-11-05 00:24:04
  • 文字超长自动省略,以...代替,CSS实现

    2009-07-16 10:15:00
  • ASP获取ACCESS数据库的表名以及表名对应的字段名和字段类型

    2009-12-25 18:57:00
  • web标准知识——美化段落文本 Ⅱ

    2008-07-22 12:12:00
  • python模拟鼠标拖动操作的方法

    2021-10-02 15:06:07
  • django之跨表查询及添加记录的示例代码

    2022-11-23 14:44:25
  • 设计稿标注首屏线的确定始末

    2011-03-30 12:36:00
  • 错误的随机数_JavaScript

    2009-08-28 12:43:00
  • asp之家 网络编程 m.aspxhome.com