简体   繁体   English

Windows 10上具有Anaconda和Python 3.6的TensorFlow

[英]TensorFlow on Windows 10 with Anaconda & Python 3.6

Let me start by saying I am a beginner on Deep Learning and trying to find my way by following the Tensorflow tutorial, which is mainly applying the inception V3 method to the flowers data set. 首先,我要说我是深度学习的初学者,然后尝试通过Tensorflow教程寻找方法,该教程主要将Inception V3方法应用于flowers数据集。

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

which includes the following : 其中包括以下内容:

cd ~ 光盘〜

curl -O (flower data link) -- runs fine curl -O(花数据链接)- 运行正常

tar xzf flower_photos.tgz -- runs fine tar xzf flower_photos.tgz- 运行正常

bazel build tensorflow/examples/image_retraining:retrain --error: no bazel command found bazel构建tensorflow / examples / image_retraining:retrain --error:找不到bazel命令

In order to be able to follow this tutorial, I have also completed the Tensorflow installation tutorial and modified (replaced 35 to 36) it for Python 3.6 compatible whl as follows: pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-1.2.1-cp36-cp36m-win_amd64.whl 为了能够遵循本教程,我还完成了Tensorflow安装教程,并对其进行了修改(将其替换为35至36),以便与Python 3.6兼容,如下所示:pip install --ignore-installed --upgrade https:// storage .googleapis.com / tensorflow /窗/ CPU / tensorflow-1.2.1- CP36-cp36m-win_amd64.whl

Now back to the main question: After installing the flower data set and installing the bazel package, cygwin64. 现在回到主要问题:安装花数据集并安装bazel软件包cygwin64之后。 I went into the Bazel folder and ran the configure file as suggested in the forums as well as touch WORKSPACE and bagel build. 我进入Bazel文件夹并按照论坛中的建议运行配置文件,并触摸WORKSPACE和百吉饼构建。 When I run the command "bazel build tensorflow/examples/image_retraining:retrain" I still get the error: "Bazel command not found" 当我运行命令“ bazel build tensorflow / examples / image_retraining:retrain”时,我仍然收到错误:“找不到Bazel命令”

I followed similar questions on stackoverflow before openning up my own question, such as: questions- 41791171/bazel-build-for-tensorflow-inception-model and git clone'd the entire Tensorflow folder as instructed but resulted an eror of :bagel: command not found 在提出自己的问题之前,我在stackoverflow上遵循了类似的问题,例如:问题41791171 / bazel-build-for-tensorflow-inception-model和git按照指示克隆了整个Tensorflow文件夹,但导致了:bagel错误:找不到相关命令

To summarize, how can I run the Tensorflow Flowerset tutorial and overcome the errors of :bagel: command not found and :bazel: command not found? 总而言之,我该如何运行Tensorflow Flowerset教程并克服:bagel:命令未找到和:bazel:命令未找到的错误?

It's not mandatory to use Bazel for the TensorFlow Image Retraining tutorial . TensorFlow Image Retraining教程不是必须使用Bazel

You can also run the retrain.py located in the \\tensorflow\\examples\\image_retraining\\ folder cloned from the TensorFlow GitHub repo to retrain the Inception v3 model or Mobilenet model. 您还可以运行位于从TensorFlow GitHub库克隆重新调校该盗梦空间V3模型或Mobilenet模型\\ tensorflow \\例子\\ image_retraining \\文件夹中的retrain.py。

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

Put the Flowers datasets folder ( flower_photos ) under the image_retraining and run the retrain.py as below: 将鲜花数据集文件夹( flower_photos )放在image_retraining下,然后运行retrain.py,如下所示:

python retrain.py --image_dir flower_photos

You should see the script will download the Inception v3 model. 您应该看到脚本将下载Inception v3模型。 在此处输入图片说明

The image retraining in progress. 正在进行图像再训练。 在此处输入图片说明

After the retraining is completed, you should see the below: 重新培训完成后,您应该看到以下内容: 在此处输入图片说明

Copy both output_graph.pb and output_labels.txt in the C:\\tmp folder, which are the retrain outputs to the image_retraining folder. output_graph.pboutput_labels.txt复制到C:\\ tmp文件夹中,它们是再训练输出到image_retraining文件夹。 在此处输入图片说明

To verify the retrained model, you can run the label_image.py as below. 要验证重新训练的模型,可以按如下所示运行label_image.py It should show the top 5 predictions. 它应该显示前5个预测。

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

The expected output should be as below: 预期输出应如下所示:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM