如何在Tensorflow 1.14中将模型导出为JSON

时间:2019-09-03 08:44:52

标签: json tensorflow

我找不到任何将tensorflow 1.14模型导出为JSON的方法。

我用了一种方法-

import tensorflow as tf
from google.protobuf import json_format

with tf.Graph().as_default() as graph:
  # Add nodes to the graph...

graph_def = graph.as_graph_def()

json_string = json_format.MessageToJson(graph_def)

但这给出了GraphDef的JSON表示形式,但模型给出的不是JSON

0 个答案:

没有答案