tensorflow训练模型遇到的问题The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exis

问题描述:

TypeError: Cannot interpret feed_dict key as Tensor: The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exist. The operation, 'DecodeJpeg/contents', does not exist in the graph.

I am trying to run retrain_test.py on image but not getting output instead getting error.

Traceback (most recent call last):
File "retraining-example.py", line 88, in 
run_inference_on_image()
File "retraining-example.py", line 71, in run_inference_on_image
{'DecodeJpeg/contents:0': image_data})
File "/home/omer/installed/acaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 778, in run
run_metadata_ptr)
File "/home/omer/installed/acaconda2/lib/python2.7/site-packages/tensorflow/python/client/session.py", line 933, in _run
+ e.args[0])
TypeError: Cannot interpret feed_dict key as Tensor: The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exist. The operation, 'DecodeJpeg/contents', does not exist in the graph.

 

1:这个问题困扰了我几天,原因是新版本的tensorflow删除了DecodeJpeg/contents,所以不能使用(内心PS:官网那些更新就更新,删东西干嘛,我也是无语,浪费我两天时间)

2:然后就是各种找资料 发现很多人都遇到这个问题,但是都没有解决

最后突然在github(链接如下https://github.com/tensorflow/tensorflow/issues/12250)发现有人解决了这个问题,真是开心的一B。真心感谢这位大哥,截图如下:

tensorflow训练模型遇到的问题The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exis

上图的链接如下:https://github.com/tensorflow/tensorflow/blob/c565660e008cf666c582668cb0d0937ca86e71fb/tensorflow/examples/image_retraining/retrain.py

3:然后就问题都解决了  展示一波效果

tensorflow训练模型遇到的问题The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exis

上一篇:spark


下一篇:ERROR 1176 (42000): Key 'XXX' doesn't exist in table 'XXX'报错处理