Ber*_*oGO 11 python android neural-network tensorflow
我的项目使用Python在TensorFlow上训练MLP,然后以这种方式导出图形和权重:
tf.train.write_graph(sess.graph_def, "./", "inp.txt", True)
saver.save(sess, 'variables/model.ckpt', global_step=1)
Run Code Online (Sandbox Code Playgroud)
现在,尽管使用这两个文件将其导回到Python是好的,但似乎不可能将它用于Android或C++,因为它无法输入检查点.ckpt.
现在,我正在使用freeze_graph.py谷歌提供的脚本将两个文件合并为一个:
bazel-bin/tensorflow/python/tools/freeze_graph --input_graph=inp.txt --input_checkpoint=variables/model.ckpt-1 --output_graph=newoutput.pb --output_node_names=output
Run Code Online (Sandbox Code Playgroud)
我的问题是,有没有办法使用另一个函数而不是tf.train.write_graph导出它包含权重?
| 归档时间: |
|
| 查看次数: |
788 次 |
| 最近记录: |