Windows 10 上的 TensorFlow 和 Anaconda & Python 3.6

TensorFlow on Windows 10 with Anaconda & Python 3.6

让我说tart 我是深度学习的初学者,并尝试按照 Tensorflow 教程找到我的方法,该教程主要将 inception V3 方法应用于花卉数据集。

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

其中包括以下内容:

cd ~

curl -O(花数据link) -- 运行很好

tar xzf flower_photos.tgz --运行很好

bazel build tensorflow/examples/image_retraining:retrain --error: no bazel command found

为了能够跟上这个教程,我也完成了Tensorflow的安装教程,并针对Python 3.6 compatible whl进行了如下修改(将35替换为36):pip install --ignore-安装 --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp36-cp36m-win_amd64.whl

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

在提出我自己的问题之前,我在 Whosebug 上关注了类似的问题,例如:questions- 41791171/bazel-build-for-tensorflow-inception-model 和 git 将整个 Tensorflow 文件夹克隆为指示但导致错误:百吉饼:找不到命令

总而言之,我如何 运行 Tensorflow Flowerset 教程并克服 :bagel: command not found 和 :bazel: command not found 的错误?

TensorFlow Image Retraining tutorial.

并非必须使用 Bazel

您还可以 运行 位于 \tensorflow\examples\image_retraining\ 文件夹中的 retrain.py 从 TensorFlow GitHub repo 克隆到重新训练 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 模型。

正在进行图像重新训练。

重新训练完成后,您应该会看到以下内容:

output_graph.pboutput_labels.txt都复制到C:\tmp文件夹中,即retrain输出到 image_retraining 文件夹。

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

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

预期输出应如下所示: