Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

tensorflow for poets: "The name 'import/input' refers to an Operation not in the graph."

Tags:

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'.

like image 218
Celio Avatar asked Sep 20 '17 15:09

Celio


2 Answers

I changed ~/scripts/label_image.py line 77 and it works:

from

input_layer = "input" 

to

input_layer = "Mul" 
like image 180
Mimi Cheng Avatar answered Sep 23 '22 17:09

Mimi Cheng


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 
like image 45
The YooGle Avatar answered Sep 21 '22 17:09

The YooGle