QUEST LOG · April 7, 2019· UPDATED June 2, 2026
画像認識のエラー tensorflow KeyError "The name 'import/input' refers to an Operation not in the graph."
# 最近ぶつかった小さなエラー
python
KeyError: "The name 'import/input' refers to an Operation not in the graph."
簡単に言うと、名前を打ち間違えているので、input が input 間違いになっている、ということです。
ネットで調べて "Mul" "input"などいろいろ試しましたが、どれもダメでした。
最終的にこの記事にたどり着きました link
# まとめ
まず
tensorflowのツールで.pbをtensorboardで見られる形式に変換し、input_layer(自分の場合はplaceholder)とoutput_layerの名前を調べてから修正します。
自分のコマンドはこれです(必要に応じて変更してください)
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
出力
公開中のアプリ
iOS・Android で無料。


