【问题标题】:Use .ckpt and .meta -files to make predictions with Inception in TensorFlow使用 .ckpt 和 .meta 文件在 TensorFlow 中使用 Inception 进行预测
【发布时间】:2016-09-05 23:34:54
【问题描述】:

我使用了 Inception-library(Tensorflow/models/Inception-tutorial on github), 将自制的 TFRecord 文件提供给 imagenet_train.py,最后得到一个包含 .ckpt 和 .meta 文件的 7Gb 目录。

我如何使用它们进行实际预测?(还评估、测试、使用实际 .jpg 文件进行测试、继续训练)

接下来的步骤是什么?是否有虚拟的示例(教程)?

[我知道有一个同名的话题,但它几乎不包含问题或答案。]

【问题讨论】:

    标签: python machine-learning tensorflow


    【解决方案1】:

    https://www.tensorflow.org/versions/r0.10/how_tos/variables/index.html#restoring-variables 提供了您应该需要的几乎所有东西。

    那里的代码:

    # Add ops to save and restore all the variables.
    saver = tf.train.Saver()
    
    # Later, launch the model, use the saver to restore variables from disk, and
    # do some work with the model.
    with tf.Session() as sess:
      # Restore variables from disk.
      saver.restore(sess, "/tmp/model.ckpt")
      print("Model restored.")
      # Do some work with the model
      ...
    

    因此,在... 部分,您可以加载您的 .jpeg 文件并使用占位符和 feeddict 将它们输入网络。

    【讨论】:

    • 如果您需要更多帮助,请告诉我。这更像是一个简单的答案,可以帮助您入门。
    • “...”实际上是最让我头疼的。是否有新手友好的示例代码,无需预构建数据集即可工作?
    • 推送。请帮忙。我一直在努力使用我的检查点文件,但我真的需要它们来完成我的学校项目。
    • 哦,对不起迈克尔。生活变得忙碌起来。毕业、新工作、婴儿、找房子……我明天会抽出一些时间来帮助你,可能在午餐前后。
    • 非常感谢。恭喜你,一切顺利。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-07-16
    • 2022-12-01
    • 1970-01-01
    • 2021-07-03
    • 2019-09-09
    • 1970-01-01
    相关资源
    最近更新 更多