tensorflow 實(shí)現(xiàn)打印pb模型的所有節(jié)點(diǎn)
只有pd模型文件, 打印所有節(jié)點(diǎn)
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 實(shí)現(xiàn)打印pb模型的所有節(jié)點(diǎn)就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
相關(guān)文章
基于Python實(shí)現(xiàn)圖片一鍵切割九宮格的工具
有時(shí)候發(fā)微博時(shí)候,需要裁切圖片為九宮格,但是ps或者其他工具都太麻煩。本文就來用Python編寫一個(gè)一鍵切割九宮格的工具,希望對(duì)大家有所幫助2023-03-03
python numpy創(chuàng)造圖像矩陣示例詳解
這篇文章主要為大家介紹了python numpy創(chuàng)造圖像矩陣示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2023-08-08
利用tkinter實(shí)現(xiàn)下拉框聯(lián)動(dòng)
這篇文章主要介紹了利用tkinter實(shí)現(xiàn)下拉框聯(lián)動(dòng)問題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-01-01
numpy.transpose()實(shí)現(xiàn)數(shù)組的轉(zhuǎn)置例子
今天小編就為大家分享一篇numpy.transpose()實(shí)現(xiàn)數(shù)組的轉(zhuǎn)置例子,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2019-12-12
python中for循環(huán)的多種使用實(shí)例
for語句是Python中執(zhí)行迭代的兩個(gè)語句之一,另一個(gè)語句是while,下面這篇文章主要給大家介紹了關(guān)于python中for循環(huán)的多種使用方法,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-09-09
Windows下Python使用Pandas模塊操作Excel文件的教程
Pandas是一個(gè)強(qiáng)大的Python數(shù)據(jù)分析模塊,這里我們先使用ANACONDA來幫助獲取Pandas所以來的一些環(huán)境,然后來初步學(xué)習(xí)Windows下Python使用Pandas模塊操作Excel文件的教程2016-05-05
Python網(wǎng)絡(luò)編程基于多線程實(shí)現(xiàn)多用戶全雙工聊天功能示例
這篇文章主要介紹了Python網(wǎng)絡(luò)編程基于多線程實(shí)現(xiàn)多用戶全雙工聊天功能,結(jié)合實(shí)例形式分析了Python網(wǎng)絡(luò)編程中使用多線程進(jìn)行多用戶異步通信的原理與相關(guān)實(shí)現(xiàn)技巧,需要的朋友可以參考下2018-04-04

