Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: Attempted to use a closed Session. #3

Open
ViVi0122 opened this issue Jul 18, 2018 · 5 comments
Open

RuntimeError: Attempted to use a closed Session. #3

ViVi0122 opened this issue Jul 18, 2018 · 5 comments

Comments

@ViVi0122
Copy link

I try to running the hard way, In 2.1 Turn the Demo code into a service when i run the object_detection_api_test.py it give a error i can fix it.
This is my error and tensorflow version.
Version:
Tensorflow:1.5.0
python:3.6.3
protoc:2.6

Error:
Traceback (most recent call last):
File "object_detection_api_test.py", line 11, in
response = object_detection_api.get_objects(image)
File "/home/hallen/models/research/object_detection/tfweb/object_detection_api.py", line 90, in
get_objects
feed_dict={image_tensor: image_np_expanded})
File "/home/hallen/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line
900, in run
run_metadata_ptr)
File "/home/hallen/.local/lib/python3.6/site-packages/tensorflow/python/client/session.py", line
1058, in _run
raise RuntimeError('Attempted to use a closed Session.')
RuntimeError: Attempted to use a closed Session.

@chadwallacehart
Copy link
Member

Did the Part 1 code work ok?

@ViVi0122
Copy link
Author

ViVi0122 commented Aug 5, 2018

Yes,it work

@AmitKKhanchandani
Copy link

AmitKKhanchandani commented Dec 14, 2018

@ViVi0122 you were able to run the complete project?

What's the status now?

@ViVi0122
Copy link
Author

@AmitKKhanchandani I have this error

Traceback (most recent call last):
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 2309, in call
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 2295, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 1741, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/_compat.py", line 35, in reraise
raise value
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 2292, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 1816, in full_dispatch_request
return self.finalize_request(rv)
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 1831, in finalize_request
response = self.make_response(rv)
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 1982, in make_response
reraise(TypeError, new_error, sys.exc_info()[2])
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/_compat.py", line 34, in reraise
raise value.with_traceback(tb)
File "/usr/local/lib/python3.6/dist-packages/Flask-1.0.2-py3.6.egg/flask/app.py", line 1974, in make_response
rv = self.response_class.force_type(rv, request.environ)
File "/home/hallen/.local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 921, in force_type
response = BaseResponse(*_run_wsgi_app(response, environ))
File "/home/hallen/.local/lib/python3.6/site-packages/werkzeug/wrappers.py", line 59, in _run_wsgi_app
return _run_wsgi_app(*args)
File "/home/hallen/.local/lib/python3.6/site-packages/werkzeug/test.py", line 923, in run_wsgi_app
app_rv = app(environ, start_response)
TypeError: 'RuntimeError' object is not callable
The view function did not return a valid response. The return type must be a string, tuple, Response instance, or WSGI callable, but it was a RuntimeError.

@AmitKKhanchandani
Copy link

@ViVi0122 I'm not getting this kind of error, did you modify anything in the source code?

I did get the RuntimeError: Attempted to use a closed Session Error, but I revert tensorflow back to 1.4.0 version and got a different kind of issue which is TypeError: 1 is not JSON serializable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants