EdjeElectronics / TensorFlow-Object-Detection-on-the-Raspberry-Pi

A tutorial showing how to set up TensorFlow's Object Detection API on the Raspberry Pi
Apache License 2.0
1.14k stars 363 forks source link

File "/home/pi/.local/lib/python3.5/site-packages/picamera/camera.py", line 1704, in capture_continuous 'Timed out waiting for capture to end') #26

Open ben-barnard opened 5 years ago

ben-barnard commented 5 years ago

I followed the tutorial to the letter, and I'm so close! When I run "python3 Object_detection_picamera.py" I get the following. This website seems to indicate that it's a truncation problem. I'm not sure what to make of it, because your code looks like it's already doing what the link suggests.

My Pi Camera is an older Rev 1.3, would that matter? Using a RPi3 otherwise.

Traceback (most recent call last): File "/home/pi/.local/lib/python3.5/site-packages/picamera/camera.py", line 1704, in capture_continuous 'Timed out waiting for capture to end') picamera.exc.PiCameraRuntimeError: Timed out waiting for capture to end

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "Object_detection_picamera.py", line 130, in for frame1 in camera.capture_continuous(rawCapture, format="bgr",use_video_port=True): File "/home/pi/.local/lib/python3.5/site-packages/picamera/camera.py", line 1710, in capture_continuous encoder.close() File "/home/pi/.local/lib/python3.5/site-packages/picamera/encoders.py", line 431, in close self.stop() File "/home/pi/.local/lib/python3.5/site-packages/picamera/encoders.py", line 419, in stop self._close_output() File "/home/pi/.local/lib/python3.5/site-packages/picamera/encoders.py", line 349, in _close_output mo.close_stream(output, opened) File "/home/pi/.local/lib/python3.5/site-packages/picamera/mmalobj.py", line 371, in close_stream stream.flush() File "/home/pi/.local/lib/python3.5/site-packages/picamera/array.py", line 238, in flush self.array = bytes_to_rgb(self.getvalue(), self.size or self.camera.resolution) File "/home/pi/.local/lib/python3.5/site-packages/picamera/array.py", line 127, in bytes_to_rgb 'Incorrect buffer length for resolution %dx%d' % (width, height)) picamera.exc.PiCameraValueError: Incorrect buffer length for resolution 1280x720

StrongRay commented 5 years ago

I was also using v1.3. Maybe you can try the following:

a. sudo apt-get update and followed by upgrade b. Try “raspistill -o xxx.jpg” to see if your camera is able to capture an image c. In the code, reduce the resolution ie.

IM_WIDTH = 640 Use smaller resolution for

IM_HEIGHT = 480

Uncomment and comment out the higher resolution parameters