LeonLok / Multi-Camera-Live-Object-Tracking

Multi-camera live traffic and object counting with YOLO v4, Deep SORT, and Flask.
GNU General Public License v3.0
982 stars 285 forks source link

Got [name 'decode' is not defined] error on MacOS/RasbianOS #14

Open meng-x opened 4 years ago

meng-x commented 4 years ago

When running python app.py

I got similar error for both flask apps(object counting/traffic counting):

Stopping YOLO thread for device 0 due to error. name 'decode' is not defined [2020-07-17 20:00:03,600] ERROR in app: Exception on /video_feed/yolo/0 [GET] Traceback (most recent call last): File "/usr/local/var/pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/flask/app.py", line 2447, in wsgi_app response = self.full_dispatch_request() File "/usr/local/var/pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/flask/app.py", line 1952, in full_dispatch_request rv = self.handle_user_exception(e) File "/usr/local/var/pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/flask/app.py", line 1821, in handle_user_exception reraise(exc_type, exc_value, tb) File "/usr/local/var/pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise raise value File "/usr/local/var/pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/flask/app.py", line 1950, in full_dispatch_request rv = self.dispatch_request() File "/usr/local/var/pyenv/versions/anaconda3-5.3.1/lib/python3.7/site-packages/flask/app.py", line 1936, in dispatch_request return self.view_functions[rule.endpoint](req.view_args) File "app.py", line 58, in video_feed return Response(gen(camera_stream=camera_stream(feed_type, device, port_list), feed_type=feed_type, device=device), File "/Users/tm/Documents/TM/neox/Multi-Camera-Live-Object-Tracking/object_counting/camera_yolo.py", line 22, in init super(Camera, self).init(feed_type, device, port_list) File "/Users/tm/Documents/TM/neox/Multi-Camera-Live-Object-Tracking/object_counting/base_camera.py", line 78, in init while self.get_frame(self.unique_name) is None: File "/Users/tm/Documents/TM/neox/Multi-Camera-Live-Object-Tracking/object_counting/base_camera.py", line 90, in get_frame return BaseCamera.frame[unique_name] KeyError: ('yolo', '0')**

Searched other places, no good, seems not general issue.

I'm using: Tensorflow 1.14 Keras 2.3.1 opencv-python 4.2.0 ImageZMQ numpy 1.18.2 Flask 1.1.1 pillow

on a MacBook(10.15.5), also tried RasbianOS, both got above error.

Python version I'm using is 3.7.2, the recommended is 3.6, not sure if this is the key.

Thanks.

meng-x commented 4 years ago

I just setup the evironment with a Jetson Nano(similar OS with Raspbian), this time python3.6 is used with tensorflow-gpu 1.15.

however, no good. the same reason.

JinghaoZhao commented 4 years ago

I tried it on Win10 but cannot run it for the same reason.

bishopek commented 4 years ago

Same problem, I am unable to get it to work..

bqFirst commented 4 years ago

It doesn't work for the same reason

bqFirst commented 4 years ago

I run it successfully! First, make sure that the yolov4.weights is loaded correctly. Second, make sure that the model_image_size in the yolov4.py is the same as yolov4.weights

mingwz commented 3 years ago

Same problem, I am unable to get it to work

Chrispaoge commented 3 years ago

Same problem, I am unable to get it to work

Chrispaoge commented 3 years ago

Same problem, I am unable to get it to work

i meet the same problem , are u make it successful?

jxx1996 commented 2 years ago

First, make sure that the yolov4.weights is loaded correctly 你好,这个文件应该放在哪,去哪找这个文件