btwardow / tf-face-recognition

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

TypeError: a float is required #9

Open archenroot opened 5 years ago

archenroot commented 5 years ago

This occurs on server startup being printed in console of docker start ...:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python3.5/dist-packages/flask/_compat.py", line 35, in reraise
    raise value
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python3.5/dist-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "server.py", line 69, in detect
    print('POST /detect error: %e' % e)
TypeError: a float is required

On start the docker, I build the docker image by issuing make command from main branch, not the dockerhub one.

Then when I click on capture examples I got another error:

172.17.0.1 - - [02/Jan/2019 14:33:16] "POST /detect HTTP/1.1" 200 -
Traceback (most recent call last):
  File "server.py", line 49, in detect
    faces = recognize(detection.get_faces(image, threshold))
  File "/workspace/tensorface/recognition.py", line 19, in recognize
    X[i, :] = embedding(img_to_np(img))
  File "/workspace/tensorface/embedding.py", line 43, in embedding
    images_placeholder = tf.get_default_graph().get_tensor_by_name("input:0")
  File "/usr/local/lib/python3.5/dist-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 "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/ops.py", line 3478, in as_graph_element
    return self._as_graph_element_locked(obj, allow_tensor, allow_operation)
  File "/usr/local/lib/python3.5/dist-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."
[2019-01-02 14:33:17,209] ERROR in app: Exception on /detect [POST]

When I try to use /detect it tels me url not allowed

archenroot commented 5 years ago

There occured also another error, I will try the docker image from dockerhub first.

archenroot commented 5 years ago

Ok, the dockerhum image works fine