googlecodelabs / tensorflow-for-poets-2

Apache License 2.0
509 stars 463 forks source link

unrecognized arguments in scripts.label_image #41

Open Charith32 opened 6 years ago

Charith32 commented 6 years ago

I am on a windows. In the 5 th step on the tensorflow-for-poets-2 when I try to classify the image it gives following error. Don't know why!!!

PS C:\Users\ABANS\tensorflow-for-poets-2> python -m scripts.label_image\ --graph=tf_files/retrained_graph.pb \ --image=tf_files/flower_photos/roses/2414954629_3708a1a04d.jpg

usage: label_image.py [-h] [--image IMAGE] [--graph GRAPH] [--labels LABELS] [--input_height INPUT_HEIGHT] [--input_width INPUT_WIDTH] [--input_mean INPUT_MEAN] [--input_std INPUT_STD] [--input_layer INPUT_LAYER] [--output_layer OUTPUT_LAYER]

label_image.py: error: unrecognized arguments: --graph=tf_files/retrained_graph.pb --image=tf_files/flower_photos/roses/2414954629_3708a1a04d.jpg

This comment doesn't show backward slash!!!

ElephantHunters commented 6 years ago

python -m scripts.label_image \ --image=tf_files/flower_photos/daisy/3475870145_685a19116d.jpg \ --graph=tf_files/optimized_graph.pb could you please try to give the command like this ,there nothing wrong with the code ,it the way you have pass on the command,ask me i have seen this error many times in my life.hope it helps

Charith32 commented 6 years ago

@ElephantHunters The retraining script wrote data to retrained_graph.pb, I think I should use it to classify the data.

ElephantHunters commented 6 years ago

@KaseyKahne ,my bad actually i look onto tensorflow-for-poets-2 optimize for mobile tutorial ,yes that retrained_graph.pb is the one you should use python -m scripts.label_image \ --graph=tf_files/retrained_graph.pb \ --image=tf_files/flower_photos/daisy/21652746_cc379e0eea_m.jpg

almendraLau commented 5 years ago

@ElephantHunters una consulta, estoy tratando de ejecutar label_imagen.py en colaboratory de la siguiente forma:

!python label_image.py --graph = '/content/gdrive/My Drive/Colab/Image-classification-transfer-learning-master/retrained_graph.pb' --image ='/content/gdrive/My Drive/Colab/Image-classification-transfer-learning-master/gato.jpg'

Pero me sale este error:

usage: label_image.py [-h] [--image IMAGE] [--graph GRAPH] [--labels LABELS] [--input_height INPUT_HEIGHT] [--input_width INPUT_WIDTH] [--input_mean INPUT_MEAN] [--input_std INPUT_STD] [--input_layer INPUT_LAYER] [--output_layer OUTPUT_LAYER] label_image.py: error: unrecognized arguments: /content/gdrive/My Drive/Colab/Image-classification-transfer-learning-master/retrained_graph.pb

Talves usted podria ayudarme. Seria de mucha ayuda su respuesta. Gracias