我正在使用
中的分类器代码[https://gist.github.com/anonymous/b222771592edf80f1a3783d47c3da988#file-gistfile1-txt][1]
运行close时出现以下错误
(base) C:\Users\pgooneti>python c:\Mylabel_image.py c:\test_image\good\2.jpg
2018-12-20 12:36:22.655174: I T:\src\github\tensorflow\tensorflow\core\platform\cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
Traceback (most recent call last):
File "C:\Users\pgooneti\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1040, in _run
subfeed, allow_tensor=True, allow_operation=False)
File "C:\Users\pgooneti\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3339, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "C:\Users\pgooneti\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 3381, in _as_graph_element_locked
"graph." % (repr(name), repr(op_name)))
KeyError: "The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exist. The operation, 'DecodeJpeg/contents', does not exist in the graph."
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Mylabel_image.py", line 11, in <module>
predictions = sess.run(softmax_tensor, {'DecodeJpeg/contents:0': image_data})
File "C:\Users\pgooneti\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 877, in run
run_metadata_ptr)
File "C:\Users\pgooneti\AppData\Local\Continuum\anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1043, in _run
'Cannot interpret feed_dict key as Tensor: ' + 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.
主要是:
KeyError: "The name 'DecodeJpeg/contents:0' refers to a Tensor which does not exist. The operation, 'DecodeJpeg/contents', does not exist in the graph."
是否可以解决此问题?