张量流中使用tf.save时的模型格式

时间:2016-05-10 03:49:31

标签: tensorflow

众所周知,我们可以在培训时使用fread保存模型。

但是存储的模型文件的格式是什么?是否可以使用 * @param documents: * RDD of documents, which are term (word) count vectors paired with IDs. * The term count vectors are "bags of words" with a fixed-size vocabulary * (where the vocabulary size is the length of the vector). * This must use the same vocabulary (ordering of term counts) as in training. * Document IDs must be unique and >= 0. 或其他东西读取文件?

1 个答案:

答案 0 :(得分:0)

您可以在https://www.tensorflow.org/versions/r0.8/how_tos/tool_developers/index.html找到有关文件格式以及如何解析的详细信息。

见一个简单的例子:

graph_def = graph_pb2.GraphDef()
with open(FLAGS.graph, "rb") as f:
  if FLAGS.input_binary:
    graph_def.ParseFromString(f.read)
  else:
    text_format.Merge(f.read(), graph_def)

您可以在网页上找到更多示例。