Solved: Tensorflow’s bug: returns error during classification


If following the codelabs for Retrain an Image Classifier for New Categories (CNN network) – ( training worked fine but when you runned the script ( to evaluate a image:

python -m scripts.label_image \
    --graph=tf_files/retrained_graph.pb  \

and You’ve got the following error:

The name 'import/input' refers to an Operation not in the graph.

that means that You can solve it on two possible way:
1. According to me the Best Option relying on add two parameters to 

–input_height=299 –input_width=299

python3 -m scripts.label_image \
--graph=tf_files/retrained_graph.pb \
--image=tf_files/flower_photos/daisy/21652746_cc379e0eea_m.jpg \
--input_layer=Mul \
--input_height=299 --input_width=299


2. change ~/scripts/ line 77 and it works:


input_layer = "input"


input_layer = "Mul"


Below presented working script with returned result of classification – problem solved by added 2 mentioned parameters: