程式筆記
Tensorflow
辨識錯誤 tensorflow KeyError "The name 'import/input' refers to an Operation not in the graph."
K
kidneyweakx
April 7, 2019 (Updated: December 18, 2025)
# 近期遇到的小錯誤
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
輸出
Related Articles
→
LOG-912
Hexo升級V5排除疑難雜症
> 因為剛好把電腦重灌,然後這個blog就躺在D槽等著我幫他換新的環境,然後他就被我快樂的升級了。
[程式筆記][Javascript][hexo]
@kidneyweakx→
LOG-934
C# 用VID和PID自動連線serialport
> 原本C#的serial port function官方範例,是類似這樣的
[程式筆記][C#]
@kidneyweakx→
LOG-941
Golang Json解析問題 Struct字首大小寫
> 其實這還蠻有趣的,最近在玩golang的爬蟲,高效率的編譯和好用的colly真的還挺好上手的,但是畢竟爬蟲還是要encode成Json才好做跨平台處理。
[程式筆記][Golang]
@kidneyweakx