gautam678 / Pix2Depth

DEPRECATED: Depth Map Estimation from Monocular Images
GNU General Public License v3.0
354 stars 83 forks source link

Server Error when running application #29

Open senakafdo opened 5 years ago

senakafdo commented 5 years ago

Perhaps I am doing something really silly here. Any help would be very much appreciated.

[2019-03-14 17:16:55,283] ERROR in app: Exception on / [POST]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "app.py", line 19, in main
    result_path = pix2depth(input_path,model)
  File "_path_/Pix2Depth/main.py", line 54, in pix2depth
    p1 = get_depth_map(x, loaded_model)
  File "_path_/Pix2Depth/main.py", line 111, in get_depth_map
    pred_dep = model.predict(np.array([input_image]), batch_size=1)[0]*255.
  File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 1164, in predict
    self._make_predict_function()
  File "/usr/local/lib/python2.7/site-packages/keras/engine/training.py", line 554, in _make_predict_function
    **kwargs)
  File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2744, in function
    return Function(inputs, outputs, updates=updates, **kwargs)
  File "/usr/local/lib/python2.7/site-packages/keras/backend/tensorflow_backend.py", line 2546, in __init__
    with tf.control_dependencies(self.outputs):
  File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 5028, in control_dependencies
    return get_default_graph().control_dependencies(control_inputs)
  File "/usr/local/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 4528, in control_dependencies
    c = self.as_graph_element(c)
  File "/usr/local/lib/python2.7/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 "/usr/local/lib/python2.7/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("activation_9/Tanh:0", shape=(?, 256, 256, 3), dtype=float32) is not an element of this graph.
_hostname_ - - [14/Mar/2019 17:16:55] "POST / HTTP/1.1" 500 -
LarryStanley commented 5 years ago

https://github.com/tensorflow/tensorflow/issues/14356#issuecomment-385962623

I use this fix the problem.