Windows 10上的TensorFlow与Anaconda& Python 3.6

时间:2017-08-13 01:40:19

标签: python tensorflow cygwin windows-10 anaconda

首先让我说我是深度学习的初学者,并尝试通过遵循Tensorflow教程找到自己的方式,该教程主要是将初始V3方法应用于鲜花数据集。

https://www.tensorflow.org/tutorials/image_retraining

包括以下内容:

cd~

curl -O(花卉数据链接) - 运行良好

tar xzf flower_photos.tgz - 运行良好

bazel build tensorflow / examples / image_retraining:retrain - 错误:找不到bazel命令

为了能够学习本教程,我还完成了Tensorflow安装教程,并修改了(替换为35到36)它与Python 3.6兼容,如下所示:pip install --ignore-installed --upgrade {{ 3}}

现在回到主要问题:安装花卉数据集并安装bazel包后,cygwin64。我进入了Bazel文件夹并按照论坛中的建议运行配置文件,并触摸WORKSPACE和bagel构建。当我运行命令" bazel build tensorflow / examples / image_retraining:retrain"我仍然得到错误:"未找到Bazel命令"

我在打开我自己的问题之前跟踪了类似的关于stackoverflow的问题,例如:questions- 41791171 / bazel-build-for-tensorflow-inception-model和git clone'整个Tensorflow文件夹按指示但是结果是eror:bagel:命令未找到

总结一下,如何运行Tensorflow Flowerset教程并克服以下错误:bagel:command not found and:bazel:command not found?

1 个答案:

答案 0 :(得分:0)

TensorFlow Image Retraining tutorial使用 Bazel 并非强制性。

您还可以运行位于TensorFlow GitHub仓库克隆的\ tensorflow \ examples \ image_retraining \文件夹中的 retrain.py ,以重新启动Inception v3模型或Mobilenet模型。

https://raw.githubusercontent.com/tensorflow/tensorflow/master/tensorflow/examples/image_retraining/retrain.py

将Flowers数据集文件夹( flower_photos )放在image_retraining下并运行retrain.py,如下所示:

python retrain.py --image_dir flower_photos

您应该看到该脚本将下载Inception v3模型。 enter image description here

图像重新训练正在进行中。 enter image description here

再培训完成后,您应该看到以下内容: enter image description here

output_graph.pb output_labels.txt 复制到C:\ tmp文件夹中,这是重新训练输出到image_retraining文件夹。 enter image description here

要验证重新训练的模型,您可以运行 label_image.py ,如下所示。 它应该显示前5个预测。

python label_image.py --image=flower_photos\daisy\21652746_cc379e0eea_m.jpg --graph=output_graph.pb --labels=output_labels.txt

预期输出应如下:

enter image description here