Last active
April 16, 2020 06:51
-
-
Save pra-dan/d857971d0f6fd5f446c189871a1ca949 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This script will help print the inputs and output layer names of Tensorflow graph files (.pb) | |
import tensorflow as tf | |
gf = tf.GraphDef() | |
m_file = open('/content/frozen_darknet_yolov3_model.pb','rb') | |
gf.ParseFromString(m_file.read()) | |
with open('somefile.txt', 'a') as the_file: | |
for n in gf.node: | |
the_file.write(n.name+'\n') | |
file = open('somefile.txt','r') | |
data = file.readlines() | |
print ("output name = ") | |
print (data[len(data)-1]) | |
print ("Input name = ") | |
file.seek ( 0 ) | |
print (file.readline()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment