【问题标题】:How to use model.ckpt and inception v-3 to predict images?如何使用model.ckpt和inception v-3来预测图像?
【发布时间】:2016-06-16 10:12:36
【问题描述】:

现在我正面临有关 inception v-3 和检查点数据的问题。 我一直在处理通过我的图像更新 inception-v3 的检查点数据,阅读下面的 git 页面并成功制作新的检查点数据。

https://github.com/tensorflow/models/tree/master/inception

一开始我以为只要稍微改动一下代码,我就可以使用这些检查点数据来识别新的图像数据,比如下面的 url。

https://www.tensorflow.org/versions/master/tutorials/image_recognition/index.html

我一开始以为“classify.py”之类的会读取新的检查点数据,只需“pythonclassify.py -image something.png”,程序就可以识别图像数据。但它并没有...... 我真的需要帮助。 谢谢。

【问题讨论】:

    标签: tensorflow tensorflow-serving imagenet


    【解决方案1】:

    要输入 .pb 文件,在训练期间,还要导入 tf.train.write_graph(sess.graph.as_graph_def(), 'path_to_folder', 'input_graph.pb',False)

    如果你已经下载了inception v3源代码,在inception_train.py中,添加我上面写的那行,在下面 saver.save(sess, checkpoint_path, global_step=step)。 (保存检查点的位置)

    希望这会有所帮助!

    【讨论】:

      【解决方案2】:

      要在 label_image 示例中使用您的检查点和模型,您需要运行 tensorflow/python/tools/freeze_graph 脚本将变量转换为存储在 GraphDef 中的常量。例如,这就是我们创建该示例代码中使用的图形文件的方式。

      【讨论】:

      • 感谢您的回复。但实际上我从重新训练得到的输出只有检查点、model.ckpt 和 model.ckpt.meta 数据。甚至没有 .pb 数据可以尝试fleze_graph
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-08
      • 2018-03-10
      • 2017-03-19
      • 1970-01-01
      • 2021-09-11
      • 2016-11-17
      • 2019-05-19
      相关资源
      最近更新 更多