【问题标题】:Tensorflow Retrain on WindowsWindows 上的 TensorFlow 再训练
【发布时间】:2017-05-16 22:35:46
【问题描述】:

当我按照“How to Retrain Inception's Final Layer for New Categories”的教程时,我需要像这样构建保持器

bazel build tensorflow/examples/image_retraining:retrain

但是,我在 windows 上的 tensorflow 没有这样的目录。我想知道为什么以及如何解决这个问题?

提前谢谢你

【问题讨论】:

    标签: python windows machine-learning tensorflow


    【解决方案1】:

    在我的例子中,tensorflow 版本是 1.2,对应的 retrain.py 是 herehere 下载并提取花卉图像。 现在运行 retrain.py 文件为

    python retrain.py --image_dir=path\to\dir\where\flowers\images\where\extracted --output_lables=retrained_labels.txt --output_graph=retrained_graph.pb

    注意:上述命令中的最后两个参数是可选的。

    现在测试重新训练的模型:

    • master branch下载label_image.py代码如下图
    • 然后运行python label_image.py --image=image/path/to/test/classfication --graph=retrained_graph.pb --labels=retrained_labels.txt
    • 结果类似于

    【讨论】:

      【解决方案2】:

      从屏幕截图看来,您已经安装了 TensorFlow PIP 包,而 image retraining tutorial 中的说明假设您已经克隆了 Git repository(并且可以使用 bazel 构建 TensorFlow)。

      不过,幸运的是,用于图像再训练的脚本 (retrain.py) 是一个简单的 Python 脚本,您无需构建任何内容即可下载并运行该脚本。只需从与您安装的软件包匹配的 TensorFlow 存储库的分支下载 retrain.py 的副本(例如,如果您已安装 TensorFlow 0.12,您可以下载 this version),您应该可以通过键入 @987654328 来运行它@ 在命令提示符下。

      【讨论】:

      【解决方案3】:

      我在 Windows 上遇到了同样的问题。我的窗口找不到script.retrain。我从 tensoflow 网站here 下载了retrain.py 文件。然后,复制 tensorflow 文件夹中的文件并使用 Python 命令运行重新训练脚本。

      【讨论】:

      • 在我的系统中哪里可以找到 Tensorflow 文件夹
      猜你喜欢
      • 2018-05-22
      • 2017-06-19
      • 2016-03-09
      • 2018-01-06
      • 2011-05-13
      • 2023-03-22
      • 2020-08-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多