google-coral / example-object-tracker

Apache License 2.0
105 stars 32 forks source link

Error while processing websocket request #8

Open zdavatz opened 3 years ago

zdavatz commented 3 years ago

I am fooling around with the tooling and noted the following:

  1. run the samples with
  2. edgetpu_detect_server --model mobilenet_ssd_v2_coco_quant_postprocess_edgetpu.tflite --labels coco_labels.txt --filter person,car,truck,bus,motocycle,bicycle --threshold 0.4 --print
  3. Normally everything works fine and I watch my output on 192.168.0.7:4664
  4. But sometimes the whole thing crashes with the following output:
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/edgetpuvision/gstreamer.py", line 230, in on_new_sample
    command=custom_command)
    File "/usr/lib/python3/dist-packages/edgetpuvision/camera.py", line 43, in render_overlay
    self.render_overlay(tensor, layout, command)
    File "/usr/lib/python3/dist-packages/edgetpuvision/apps.py", line 48, in render_overlay
    overlay = gen.send((tensor, layout, command))
    StopIteration
    INFO:edgetpuvision.streaming.server:Server is shutting down
    INFO:edgetpuvision.streaming.server:Camera stop recording
    INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Stopping...
    ERROR:edgetpuvision.streaming.server:[192.168.0.1:60322] Error while processing websocket request
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 584, in _receive_message
    packet = self._receive_packet()
    File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 626, in _receive_packet
    packet.fin = buf[0] & 0x80 > 0
    IndexError: index out of range
    INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Tx thread finished
    INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Rx thread finished
    INFO:edgetpuvision.streaming.server:[192.168.0.1:60322] Stopped.
    INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Stopping...
    INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Tx thread finished
    ERROR:edgetpuvision.streaming.server:[192.168.0.1:35718] Error while processing websocket request
    Traceback (most recent call last):
    File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 584, in _receive_message
    packet = self._receive_packet()
    File "/usr/lib/python3/dist-packages/edgetpuvision/streaming/server.py", line 626, in _receive_packet
    packet.fin = buf[0] & 0x80 > 0
    IndexError: index out of range
    INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Rx thread finished
    INFO:edgetpuvision.streaming.server:[192.168.0.1:35718] Stopped.
    INFO:edgetpuvision.streaming.server:Done
    0: Object(id=0, score=0.58203125, bbox=BBox(xmin=143, ymin=170, xmax=153, ymax=193)), area=230.00
    Traceback (most recent call last):
    File "/usr/bin/edgetpu_detect_server", line 11, in <module>
    load_entry_point('edgetpuvision==7.0', 'console_scripts', 'edgetpu_detect_server')()
    File "/usr/lib/python3/dist-packages/edgetpuvision/detect_server.py", line 33, in main
    run_server(add_render_gen_args, render_gen)
    File "/usr/lib/python3/dist-packages/edgetpuvision/apps.py", line 52, in run_server
    signal.pause()
    KeyboardInterrupt
  5. After this I kill the commandline and restart and everything is fine again.
  6. I think this happens if the stream is opened and closed from different Browsers. Opening the stream via 192.168.0.7:4664 starts the recording and if you close the browser windows it stops the recording. So then the process seems to crash if that happens by several different open browser windows.
  7. Is there an option to run this as a background process?
zdavatz commented 3 years ago

Sometimes the whole process hangs with

Inference (rate=27.19 fps):INFO:edgetpuvision.streaming.server:[192.168.0.72:59578] Stopping...
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/edgetpuvision/gstreamer.py", line 230, in on_new_sample
INFO:edgetpuvision.streaming.server:[192.168.0.72:59578] Stopped.
INFO:edgetpuvision.streaming.server:Number of active clients: 0
INFO:edgetpuvision.streaming.server:Camera stop recording
    command=custom_command)
  File "/usr/lib/python3/dist-packages/edgetpuvision/camera.py", line 43, in render_overlay
    self.render_overlay(tensor, layout, command)
  File "/usr/lib/python3/dist-packages/edgetpuvision/apps.py", line 48, in render_overlay
    overlay = gen.send((tensor, layout, command))
  File "/usr/lib/python3/dist-packages/edgetpuvision/detect.py", line 160, in render_gen
    print_results(inference_rate, objs)
  File "/usr/lib/python3/dist-packages/edgetpuvision/detect.py", line 121, in print_results
    print('\nInference (rate=%.2f fps):' % inference_rate)
BlockingIOError: [Errno 11] write could not complete without blocking