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

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

hktxt opened this issue · 1 comments

hktxt commented

I followed the instructions to build OD on my raspberry pi.
while runing live stream video camera, it can run about 1 minute and than have a proplem that:

Traceback (most recent call last):
File "Object_detection_picamera_1.py", line 196, in
feed_dict={image_tensor: frame_expanded})
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 950, in run
run_metadata_ptr)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/client/session.py", line 1142, in _run
np_val = np.asarray(subfeed_val, dtype=subfeed_dtype)
File "/usr/local/lib/python3.5/dist-packages/numpy/core/_asarray.py", line 85, in asarray
return array(a, dtype, copy=False, order=order)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
VIDIOC_REQBUFS: No such device

I found some sugesstions online are not working.
sudo modprobe bcm2835-v4l2
replace "video = cv2.VideoCapture(0)" to "video = cv2.VideoCapture(1)"

some people met the same problem as well. TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

That means the script was unable to get a frame from the camera, which most likely means your camera stopped working. I recommend borrowing a different camera and trying that one to see if it works.