MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / _parse_input_meta_graph_proto

Function _parse_input_meta_graph_proto

tensorflow/python/tools/freeze_graph.py:257–269  ·  view source on GitHub ↗

Parses input tensorflow graph into MetaGraphDef proto.

(input_graph, input_binary)

Source from the content-addressed store, hash-verified

255
256
257def _parse_input_meta_graph_proto(input_graph, input_binary):
258 """Parses input tensorflow graph into MetaGraphDef proto."""
259 if not gfile.Exists(input_graph):
260 raise IOError("Input meta graph file '" + input_graph + "' does not exist!")
261 input_meta_graph_def = MetaGraphDef()
262 mode = "rb" if input_binary else "r"
263 with gfile.GFile(input_graph, mode) as f:
264 if input_binary:
265 input_meta_graph_def.ParseFromString(f.read())
266 else:
267 text_format.Merge(f.read(), input_meta_graph_def)
268 print("Loaded meta graph file '" + input_graph)
269 return input_meta_graph_def
270
271
272def _parse_input_saver_proto(input_saver, input_binary):

Callers 1

freeze_graphFunction · 0.85

Calls 6

IOErrorFunction · 0.85
MetaGraphDefClass · 0.85
ExistsMethod · 0.45
ParseFromStringMethod · 0.45
readMethod · 0.45
MergeMethod · 0.45

Tested by

no test coverage detected