btwardow / tf-face-recognition

Ral-Time Tensor Flow Face Detection and Recognition
MIT License
67 stars 20 forks source link

"The name 'input:0' refers to a Tensor which does not exist. The operation, 'input', does not exist in the graph." #10

Open sumit1212 opened 5 years ago

sumit1212 commented 5 years ago

When I change my system to high configuration this issue will come Traceback (most recent call last): File "server.py", line 50, in detect faces = recognize(detection.get_faces(image, threshold)) File "/home/bigblue/Music/Test/tf-face-recognition-master/tensorface/recognition.py", line 19, in recognize X[i, :] = embedding(img_to_np(img)) File "/home/bigblue/Music/Test/tf-face-recognition-master/tensorface/embedding.py", line 66, in embedding images_placeholder = tf.get_default_graph().get_tensor_by_name("input:0") File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3654, in get_tensor_by_name return self.as_graph_element(name, allow_tensor=True, allow_operation=False) File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/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 "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/ops.py", line 3520, in _as_graph_element_locked "graph." % (repr(name), repr(op_name))) KeyError: "The name 'input:0' refers to a Tensor which does not exist. The operation, 'input', does not exist in the graph." 192.168.1.32 - - [14/Jan/2019 13:10:45] "POST /detect HTTP/1.1" 500 - Traceback (most recent call last): File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 2309, in __call__ return self.wsgi_app(environ, start_response) File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 2295, in wsgi_app response = self.handle_exception(e) File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 1741, in handle_exception reraise(exc_type, exc_value, tb) File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise raise value File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 2292, in wsgi_app response = self.full_dispatch_request() File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 1815, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 1718, in handle_user_exception reraise(exc_type, exc_value, tb) File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/_compat.py", line 35, in reraise raise value File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 1813, in full_dispatch_request rv = self.dispatch_request() File "/home/bigblue/anaconda3/envs/my_env/lib/python3.6/site-packages/flask/app.py", line 1799, in dispatch_request return self.view_functions[rule.endpoint](**req.view_args) File "/home/bigblue/Music/Test/tf-face-recognition-master/server/server.py", line 95, in detect print('POST /detect error: %e' % e) TypeError: must be real number, not KeyError Why this error come when I'm running "server.py" please suggest me what to do now My system configuration is Memory - 3.7 GiB Processor- Intel® Core™ i5-2500 CPU @ 3.30GHz × 4 Graphics - Intel® Sandybridge Desktop OS Type - 64-bit Please help me out I have try lot of solution but don't work.

btwardow commented 5 years ago

From the above listing and python path I assume you are not running it from docker. Please use docker, it should help you with a start.

sumit1212 commented 5 years ago

when I run with docker same issue will comes. But currently I'm run on environment. Is there "input:0" refers to system related error.

archenroot commented 5 years ago

Same error here running from local environment on Gentoo, found some refs: https://ncsforum.movidius.com/discussion/589/keyerror-the-name-input-0-refers-to-a-tensor-which-does-not-exist-when-compile-retrained-model/p2 https://ncsforum.movidius.com/discussion/640/keyerror-the-name-input-0-refers-to-a-tensor-which-does-not-exist

I think it runs fine under virutal env, or was at least on my other computer(laptop) few weeks ago. The main difference is only a fact, that on laptop i have no GPU, so tf runs in cpu mode, here I have 1080ti and cannot make it running.

archenroot commented 5 years ago

Mostly I found this, its related to shapes unnamed... need to discover more: https://github.com/Microsoft/vs-tools-for-ai/issues/16