I was following the codelabs tensorflow for poets and the training worked fine but when I runned the script to evaluate a image:
python -m scripts.label_image \ --graph=tf_files/retrained_graph.pb \ --image=tf_files/flower_photos/daisy/21652746_cc379e0eea_m.jpg
I got the following error:
The name 'import/input' refers to an Operation not in the graph.
I looked around and it has something to do with chosing the input and output layer, the script label_image.py has 'input' and 'output' set as default. The architecture I'm using is 'inception_v3'.
I changed ~/scripts/label_image.py line 77 and it works:
from
input_layer = "input"
to
input_layer = "Mul"
Use --input_layer name as Placeholder. It will work because the retrain.py script has set default value of input_layer as "Placeholder".
python label_image.py --graph=retrained_graph.pb --labels=retrained_labels.txt --output_layer=final_result --image=testimage654165.jpg --input_layer=Placeholder
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With