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。真心感谢这位大哥,截图如下:

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

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

相关文章

MNIST数据集可以说是深度学习的入门,但是使用模型预测单张M...
1、新建tensorflow环境(1)打开anacondaprompt,输入命令行...
这篇文章主要介绍“张量tensor是什么”,在日常操作中,相信...
tensorflow中model.fit()用法model.fit()方法用于执行训练过...
https://blog.csdn.net/To_be_little/article/details/12443...
根据身高推测体重const$=require('jquery');const...