【问题标题】:How to freeze graphs from checkpoint directory for inception-v3 model?如何冻结 inception-v3 模型的检查点目录中的图形?
【发布时间】:2017-03-22 16:56:45
【问题描述】:

我正在使用这个来微调 inception-v3 模型花:https://github.com/tensorflow/models/tree/master/inception

我在一个目录中检查了结果。但在目录中,我看到如下文件: -rw-r--r-- 1 root root 389908432 Mar 15 21:46 model.ckpt-0.data-00000-of-00001 -rw-r--r-- 1 root root 72680 Mar 15 21:46 model.ckpt-0.index -rw-r--r-- 1 root root 15189794 Mar 15 21:47 model.ckpt-0.meta -rw-r--r-- 1 root root 135185788 Mar 15 22:36 events.out.tfevents.1489594533.f7d5defbed64 -rw-r--r-- 1 root root 72680 Mar 15 22:37 model.ckpt-4999.index -rw-r--r-- 1 root root 389908432 Mar 15 22:37 model.ckpt-4999.data-00000-of-00001 -rw-r--r-- 1 root root 15189794 Mar 15 22:38 model.ckpt-4999.meta -rw-r--r-- 1 root root 130 Mar 15 22:49 checkpoint 而我需要在与此类似的目录中输出: -rw-r----- 1 107456 5000 223 Mar 2 2016 README.txt -rw-r----- 1 107456 5000 43 Mar 2 2016 checkpoint -rw-r----- 1 107456 5000 434903494 Mar 15 2016 model.ckpt-157585

为此我需要做一些类似冻结的事情,但冻结需要提供 output_node_names。谁能指导我,inception-v3 的 output_node_names 是什么? 另外,我需要一种可靠的冷冻方法。 tensorflow freezer 工具可以解决这个问题吗?

【问题讨论】:

    标签: tensorflow


    【解决方案1】:

    我终于找到了答案。

    单行答案应该是使用上游 Tensorflow 代码库中可用的 freezer.py。请参阅有关如何在测试中使用该程序的示例。

    您可以查看以下链接以获取示例: https://gist.githubusercontent.com/morgangiraud/249505f540a5e53a48b0c1a869d370bf/raw/6cb0b4d497925517316a92f935ce5dccb6aafd17/medium-tffreeze-1.py

    【讨论】:

    • 只是好奇,inception v3 的输出节点名称是什么?
    • 我在微调后尝试了下面的脚本,但一直收到“AssertionError”,因为 Inception v3 中的输出节点名称不存在“Accuracy/Predictions”。我试过用“Softmax”和其他任何合理的东西替换那个字段,但它仍然不起作用。你能告诉我你是怎么做到的吗?
    • 但是如果你真的想使用输出节点,请检查初始模型..在那个文件中提到了
    • for i in tf.get_default_graph().get_operations(): print i.name
    猜你喜欢
    • 1970-01-01
    • 2018-02-07
    • 2017-11-23
    • 1970-01-01
    • 2018-01-06
    • 1970-01-01
    • 2018-05-20
    • 2018-05-31
    • 1970-01-01
    相关资源
    最近更新 更多