Skip to content

Commit eb0d217

Browse files
committed
1
1 parent b59f1eb commit eb0d217

File tree

7 files changed

+59
-0
lines changed

7 files changed

+59
-0
lines changed

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/tensorflow_lite_tutorial.iml

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

modelinfo.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import tensorflow as tf
2+
3+
4+
model_file = "xorGate.pb"
5+
6+
def load_graph(pbmodelFile):
7+
with tf.gfile.GFile(pbmodelFile, "rb") as f:
8+
graph_def = tf.GraphDef()
9+
graph_def.ParseFromString(f.read())
10+
11+
with tf.Graph().as_default() as graph:
12+
tf.import_graph_def(graph_def)
13+
14+
input_name = graph.get_operations()[0].name+':0'
15+
output_name = graph.get_operations()[-1].name+':0'
16+
17+
return graph, input_name, output_name
18+
19+
20+
graph, inputName, outputName = load_graph(model_file)
21+
input_x = graph.get_tensor_by_name(inputName)
22+
output_y = graph.get_tensor_by_name(outputName)
23+
24+
print(input_x)
25+
print(output_y)

xorGate.lite

1.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)