Retraining Tensorflow on Windows

When I follow the tutorials " How to Transfer the Entry End Level for New Categories" , I need to build a latch similar to this

bazel build tensorflow/examples/image_retraining:retrain 

However, my tensor flow on windows does not have such a directory. I wonder why and how can I solve the problem? enter image description here

Thank you in advance

+6
source share
3 answers

From the screenshot you can see that you installed the TensorFlow PIP package, while the instructions in the image retraining manual assume that you cloned the Git repository (and you can use bazel to build TensorFlow).

However, fortunately, the script ( retrain.py ) for retraining images is a simple Python script that you can load and run without creating anything. Just download a copy of retrain.py from the TensorFlow repository branch that matches your installed package (for example, if you installed TensorFlow 0.12, you can download this version ) and you can run it by typing python retrain.py at the command line.

+5
source

In my case, the tensorflow version is 1.2, and the corresponding retrain.py is here . enter image description here Download and extract color images from here . Now run the retrain.py file as

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

Note: the last two arguments in the above command are optional.

Now, to test the revised model:

  • go to master branch and load the label_image.py code as shown below.
  • enter image description here
  • Then run python label_image.py --image=image/path/to/test/classfication --graph=retrained_graph.pb --labels=retrained_labels.txt
  • The result will look like enter image description here
+6
source

I had the same problem with windows. My windows could not find script.retrain . I downloaded the retrain.py file from tensoflow website at here . Then copy the file to the tensorflow folder and run the reinstallation of the script using the Python command.

+1
source

Source: https://habr.com/ru/post/1013714/


All Articles