QUEST LOG · April 7, 2019· UPDATED June 2, 2026

Recognition Error: tensorflow KeyError "The name 'import/input' refers to an Operation not in the graph."

# A small error I ran into recently

python
KeyError: "The name 'import/input' refers to an Operation not in the graph."

1.00
1.00

Put simply, you typed the name wrong, so your input is, well, input wrong.

I dug through posts online and tried all kinds of things like "Mul" "input", and they were all wrong.

In the end I found this article: link ↗

# TL;DR

First use tensorflow's tools to convert the .pb into a format you can view in tensorboard, then look up what the input_layer (mine was placeholder) and output_layer are actually named, and fix them.

Here's my command (adjust it to your own needs):

python
python tensorflow\examples\label_image\label_image.py --graph=tmp\output_graph.pb --label=tmp\output_labels.txt --image=tmp\91076.png --input_layer=Placeholder --output_layer=final_result

Output

Apps I ship

Free on iOS and Android.

Solid(ar)ity

Solid(ar)ity

A privacy-first identity wallet: zero-knowledge proofs and signed cards swapped face to face, no central server.