0
votes

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.

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

which includes the following :

cd ~

curl -O (flower data link) -- runs fine

tar xzf flower_photos.tgz --runs fine

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

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

Now back to the main question: After installing the flower data set and installing the bazel package, 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. When I run the command "bazel build tensorflow/examples/image_retraining:retrain" I still get the error: "Bazel command not found"

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

To summarize, how can I run the Tensorflow Flowerset tutorial and overcome the errors of :bagel: command not found and :bazel: command not found?

1

1 Answers

0
votes

It's not mandatory to use Bazel for the TensorFlow Image Retraining tutorial.

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.

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:

python retrain.py --image_dir flower_photos

You should see the script will download the Inception v3 model. enter image description here

The image retraining in progress. enter image description here

After the retraining is completed, you should see the below: enter image description here

Copy both output_graph.pb and output_labels.txt in the C:\tmp folder, which are the retrain outputs to the image_retraining folder. enter image description here

To verify the retrained model, you can run the label_image.py as below. It should show the top 5 predictions.

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:

enter image description here