TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("input_1:0", shape=(?, 456, 456, 3), dtype=float32) is not an element of this graph. #30
`(tfenv) D:\DeepLearnning\Code\RubbishSort\garbage_classify-master>python run.py --mode=eval --eval_pb_path=./model_snapshots/model --test_data_url=./datasets/garbage_classify/tr
ain_data --num_classes=40
Using TensorFlow backend.
2020-03-12 10:09:15.415268: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
2020-03-12 10:09:16.536963: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties:
name: GeForce MX250 major: 6 minor: 1 memoryClockRate(GHz): 1.582
pciBusID: 0000:06:00.0
totalMemory: 2.00GiB freeMemory: 1.62GiB
2020-03-12 10:09:16.571051: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2020-03-12 10:09:25.865212: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-12 10:09:25.879351: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2020-03-12 10:09:25.885838: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2020-03-12 10:09:25.956745: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1364 MB memory)
-> physical GPU (device: 0, name: GeForce MX250, pci bus id: 0000:06:00.0, compute capability: 6.1)
WARNING:tensorflow:From D:\DeepLearnning\Code\RubbishSort\garbage_classify-master\eval.py:131: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be re
moved in a future version.
Instructions for updating:
This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function
for importing SavedModels in Tensorflow 2.0.
WARNING:tensorflow:From D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.chec
kpoint_management) is deprecated and will be removed in a future version.
Instructions for updating:
Use standard file APIs to check for files with this prefix.
2020-03-12 10:09:38.781264: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0
2020-03-12 10:09:38.846031: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix:
2020-03-12 10:09:38.874307: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0
2020-03-12 10:09:38.876455: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N
2020-03-12 10:09:38.889822: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1364 MB memory)
-> physical GPU (device: 0, name: GeForce MX250, pci bus id: 0000:06:00.0, compute capability: 6.1)
Traceback (most recent call last):
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1092, in _run
subfeed, allow_tensor=True, allow_operation=False)
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\ops.py", line 3478, in as_graph_element
return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\ops.py", line 3557, in _as_graph_element_locked
raise ValueError("Tensor %s is not an element of this graph." % obj)
ValueError: Tensor Tensor("input_1:0", shape=(?, 456, 456, 3), dtype=float32) is not an element of this graph.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 169, in
tf.app.run()
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "run.py", line 165, in main
eval_model(FLAGS)
File "D:\DeepLearnning\Code\RubbishSort\garbage_classify-master\eval.py", line 215, in eval_model
test_single_model(FLAGS)
File "D:\DeepLearnning\Code\RubbishSort\garbage_classify-master\eval.py", line 159, in test_single_model
pred_score = sess1.run([output_score], feed_dict={input_images: img})
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1095, in _run
'Cannot interpret feed_dict key as Tensor: ' + e.args[0])
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("input_1:0", shape=(?, 456, 456, 3), dtype=float32) is not an element of this graph.
`
我在--mode=eval估值的时候遇到了这个问题,请教博主!
`(tfenv) D:\DeepLearnning\Code\RubbishSort\garbage_classify-master>python run.py --mode=eval --eval_pb_path=./model_snapshots/model --test_data_url=./datasets/garbage_classify/tr ain_data --num_classes=40 Using TensorFlow backend. 2020-03-12 10:09:15.415268: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 2020-03-12 10:09:16.536963: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1433] Found device 0 with properties: name: GeForce MX250 major: 6 minor: 1 memoryClockRate(GHz): 1.582 pciBusID: 0000:06:00.0 totalMemory: 2.00GiB freeMemory: 1.62GiB 2020-03-12 10:09:16.571051: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2020-03-12 10:09:25.865212: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-03-12 10:09:25.879351: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 2020-03-12 10:09:25.885838: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N 2020-03-12 10:09:25.956745: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1364 MB memory) -> physical GPU (device: 0, name: GeForce MX250, pci bus id: 0000:06:00.0, compute capability: 6.1) WARNING:tensorflow:From D:\DeepLearnning\Code\RubbishSort\garbage_classify-master\eval.py:131: load (from tensorflow.python.saved_model.loader_impl) is deprecated and will be re moved in a future version. Instructions for updating: This function will only be available through the v1 compatibility library as tf.compat.v1.saved_model.loader.load or tf.compat.v1.saved_model.load. There will be a new function for importing SavedModels in Tensorflow 2.0. WARNING:tensorflow:From D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\training\saver.py:1266: checkpoint_exists (from tensorflow.python.training.chec kpoint_management) is deprecated and will be removed in a future version. Instructions for updating: Use standard file APIs to check for files with this prefix. 2020-03-12 10:09:38.781264: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1512] Adding visible gpu devices: 0 2020-03-12 10:09:38.846031: I tensorflow/core/common_runtime/gpu/gpu_device.cc:984] Device interconnect StreamExecutor with strength 1 edge matrix: 2020-03-12 10:09:38.874307: I tensorflow/core/common_runtime/gpu/gpu_device.cc:990] 0 2020-03-12 10:09:38.876455: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1003] 0: N 2020-03-12 10:09:38.889822: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1115] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1364 MB memory) -> physical GPU (device: 0, name: GeForce MX250, pci bus id: 0000:06:00.0, compute capability: 6.1) Traceback (most recent call last): File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1092, in _run subfeed, allow_tensor=True, allow_operation=False) File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\ops.py", line 3478, in as_graph_element return self._as_graph_element_locked(obj, allow_tensor, allow_operation) File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\framework\ops.py", line 3557, in _as_graph_element_locked raise ValueError("Tensor %s is not an element of this graph." % obj) ValueError: Tensor Tensor("input_1:0", shape=(?, 456, 456, 3), dtype=float32) is not an element of this graph.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "run.py", line 169, in
tf.app.run()
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run
_sys.exit(main(argv))
File "run.py", line 165, in main
eval_model(FLAGS)
File "D:\DeepLearnning\Code\RubbishSort\garbage_classify-master\eval.py", line 215, in eval_model
test_single_model(FLAGS)
File "D:\DeepLearnning\Code\RubbishSort\garbage_classify-master\eval.py", line 159, in test_single_model
pred_score = sess1.run([output_score], feed_dict={input_images: img})
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 929, in run
run_metadata_ptr)
File "D:\DeepLearnning\anaconda3\envs\tfenv\lib\site-packages\tensorflow\python\client\session.py", line 1095, in _run
'Cannot interpret feed_dict key as Tensor: ' + e.args[0])
TypeError: Cannot interpret feed_dict key as Tensor: Tensor Tensor("input_1:0", shape=(?, 456, 456, 3), dtype=float32) is not an element of this graph.
`
我在--mode=eval估值的时候遇到了这个问题,请教博主!