EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi

Cannot connect to X server Segmentation fault when running #44

Edson0121 opened this issue · 2 comments

I want to run TFLite_detection_webcam.py with ssh. I know this error happens because the code needs a monitor to display the output, but how can I modify it to stop this?

Simply comment out the cv2.imshow('Object detector', frame) line in the code. In TFLite_detection_webcam.py, that's line 223. That way, it won't try to display anything to the monitor. Good luck!

I did at first, but when I run python3 TFLite_detection_webcam.py --model_dir=coco_ssd_mobilenet_v1 it doesn't run and I have to force exit with Ctrl + C. The output is:
q^CTraceback (most recent call last): File "TFLite_detection_[webcam.py](https://webcam.py/)", line 326, in <module> out.write(frameOut) KeyboardInterrupt ^CException ignored in: <module 'threading' from '/usr/lib/python3.7/[threading.py](https://threading.py/)'> Traceback (most recent call last): File "/usr/lib/python3.7/[threading.py](https://threading.py/)", line 1281, in _shutdown t.join() File "/usr/lib/python3.7/[threading.py](https://threading.py/)", line 1032, in join self._wait_for_tstate_lock() File "/usr/lib/python3.7/[threading.py](https://threading.py/)", line 1048, in _wait_for_tstate_lock elif lock.acquire(block, timeout): KeyboardInterrupt

Also, I added the write option with fourcc to save the output in a video instead of display it.