Parses input tensorflow graph into MetaGraphDef proto.
(input_graph, input_binary)
| 255 | |
| 256 | |
| 257 | def _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 | |
| 272 | def _parse_input_saver_proto(input_saver, input_binary): |
no test coverage detected