Multi-Camera-Live-Object-Tracking icon indicating copy to clipboard operation
Multi-Camera-Live-Object-Tracking copied to clipboard

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

Open meng-x opened this issue 4 years ago • 9 comments

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_functionsrule.endpoint 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 avatar Jul 17 '20 11:07 meng-x

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.

meng-x avatar Jul 18 '20 13:07 meng-x

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

JinghaoZhao avatar Jul 22 '20 03:07 JinghaoZhao

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

bishopek avatar Sep 07 '20 10:09 bishopek

It doesn't work for the same reason

bqFirst avatar Nov 06 '20 01:11 bqFirst

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

bqFirst avatar Nov 06 '20 03:11 bqFirst

Same problem, I am unable to get it to work

mingwz avatar Dec 15 '20 10:12 mingwz

Same problem, I am unable to get it to work

Chrispaoge avatar Mar 19 '21 13:03 Chrispaoge

Same problem, I am unable to get it to work

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

Chrispaoge avatar Mar 19 '21 13:03 Chrispaoge

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

jxx1996 avatar Oct 23 '22 03:10 jxx1996