您好,登錄后才能下訂單哦!
只有pd模型文件, 打印所有節點
from tensorflow.python.framework import tensor_util from google.protobuf import text_format import tensorflow as tf from tensorflow.python.platform import gfile from tensorflow.python.framework import tensor_util GRAPH_PB_PATH = 'models/frozen_person_graph.pb' #path to your .pb file with tf.Session() as sess: print("load graph") with gfile.FastGFile(GRAPH_PB_PATH,'rb') as f: graph_def = tf.GraphDef() # Note: one of the following two lines work if required libraries are available #text_format.Merge(f.read(), graph_def) graph_def.ParseFromString(f.read()) tf.import_graph_def(graph_def, name='') for i,n in enumerate(graph_def.node): print("Name of the node - %s" % n.name)
以上這篇tensorflow 實現打印pb模型的所有節點就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持億速云。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。