-
Notifications
You must be signed in to change notification settings - Fork 285
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
module 'tensorflow' has no attribute 'Session' #31
Comments
I guess it's a tensorflow version problem. This repo seems dependent on TF-1.14. Did you run it on TF2? |
Yes, the error could be due to the tensorflow version. Could you try running it with the same dependencies as mine and see if the same error still occurs? |
Tensorflow version 2 can't use session. Try to change tf.Session to tf.compat.v1.Session to get the same result. Besides when you use Keras.get_session() change that to tf.compat.v1.keras.backend.get_session(). Good luck |
I can not seem to get version 1 of tensorflow installed anymore. Does anyone know how to install tensorflow-gpu Version 1? For example when I run - sudo pip3 install "tensorflow-gpu>=1.14,<2.0" sudo pip3 install tensorflow-gpu==1.14.0 |
I am getting the following error when attempting to run this application.
Any ideas as to what is going on (what I am doing wrong)?
�[31m WARNING: This is a development server. Do not use it in a production deployment.�[0m
�[2m Use a production WSGI server instead.�[0m
127.0.0.1 - - [11/Mar/2021 16:23:21] "�[37mGET / HTTP/1.1�[0m" 200 -
Using TensorFlow backend.
Starting YOLO thread for device 0.Starting YOLO thread for device 1.
Stopping YOLO thread for device 0 due to error.Stopping YOLO thread for device 1 due to error.
[2021-03-11 16:23:23,842] ERROR in app: Exception on /video_feed/yolo/0 [GET]
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/user/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/app.py", line 60, in video_feed
return Response(gen(camera_stream=camera_stream(feed_type, device, port_list), feed_type=feed_type, device=device),
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/camera_yolo.py", line 24, in init
super(Camera, self).init(feed_type, device, port_list)
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/base_camera.py", line 78, in init
while self.get_frame(self.unique_name) is None:
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/base_camera.py", line 90, in get_frame
return BaseCamera.frame[unique_name]
KeyError: ('yolo', '0')
module 'tensorflow' has no attribute 'Session'127.0.0.1 - - [11/Mar/2021 16:23:23] "�[1m�[35mGET /video_feed/yolo/0 HTTP/1.1�[0m" 500 -
[2021-03-11 16:23:23,843] ERROR in app: Exception on /video_feed/yolo/1 [GET]
Traceback (most recent call last):
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 2447, in wsgi_app
response = self.full_dispatch_request()
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1952, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1821, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/home/user/.local/lib/python3.8/site-packages/flask/_compat.py", line 39, in reraise
raise value
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1950, in full_dispatch_request
rv = self.dispatch_request()
File "/home/user/.local/lib/python3.8/site-packages/flask/app.py", line 1936, in dispatch_request
return self.view_functionsrule.endpoint
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/app.py", line 60, in video_feed
return Response(gen(camera_stream=camera_stream(feed_type, device, port_list), feed_type=feed_type, device=device),
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/camera_yolo.py", line 24, in init
super(Camera, self).init(feed_type, device, port_list)
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/base_camera.py", line 78, in init
while self.get_frame(self.unique_name) is None:
File "/home/user/Downloads/Multi-Camera-Live-Object-Tracking-master/traffic_counting/base_camera.py", line 90, in get_frame
return BaseCamera.frame[unique_name]
KeyError: ('yolo', '1')
module 'tensorflow' has no attribute 'Session'
127.0.0.1 - - [11/Mar/2021 16:23:23] "�[1m�[35mGET /video_feed/yolo/1 HTTP/1.1�[0m" 500 -
The text was updated successfully, but these errors were encountered: