edjeelectronics / tensorflow-object-detection-on-the-raspberry-pi Goto Github PK
View Code? Open in Web Editor NEWA tutorial showing how to set up TensorFlow's Object Detection API on the Raspberry Pi
License: Apache License 2.0
A tutorial showing how to set up TensorFlow's Object Detection API on the Raspberry Pi
License: Apache License 2.0
Please note I followed the tutorial step by step apart from ignoring step 3 'git checkout v1.8.0', it resulted to deletion of previously downloaded files as highlighted in issue 1. Again very grateful to your efforts @EdjeElectronics .
Running the command 'python3 Object_detection_picamera.py ' generated the following error.
What would be the best foot forward? Thanks
Some notes:
(Not sure if relevant) On checking the files (not sure if what I didnt was correct) i noticed there is no file with 'string_int_label_map_pb2' but found 'string_int_label_map.proto'.
hi,
do you think your script could run on my (everbodies?) headless raspberry-pi?
and save a image-snapshot if an object is detected?
any ideas how to realize that (sorry, i am no coder...)..
thanks, if you find time to answer...
tozett
I have rasspery pi zero,
I did everything as you show (set related step arm6l for rasperry pi zero only)
When I write the command "python3 Object_detection_picamera.py" I got these error.
How can I fix it.
(Also I have picamera and test it, it is working)
Thanks.
pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py
Traceback (most recent call last):
File "Object_detection_picamera.py", line 84, in <module>
serialized_graph = fid.read()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/file_io.py", line 120, in read
self._preread_check()
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/lib/io/file_io.py", line 80, in _preread_check
compat.as_bytes(self.__name), 1024 * 512, status)
File "/usr/local/lib/python3.5/dist-packages/tensorflow/python/framework/errors_impl.py", line 519, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.NotFoundError: /home/pi/tensorflow1/models/research/object_detection/ssdlite_mobilenet_v2_coco_2018_05_09/frozen_inference_graph.pb; No such file or directory
Thank you for the great tutorial!
I have a question: your code gets the image in BGR (for both the picamera and USB). I thought that the tensorflow pre-built models expect RGB.
Don't you need to convert (e.g. frame= frame[:, :, [2, 1, 0]]) ?
Traceback (most recent call last):
File "Object_detection_picamera.py", line 86, in
tf.import_graph_def(od_graph_def, name='')
File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/importer.py", line 280, in import_graph_def
raise ValueError('No op named %s in defined operations.' % node.op)
ValueError: No op named NonMaxSuppressionV2 in defined operations.
Hi! I am getting the following error when I try to run step 6:
ImportError: libvtkInteractionStyle-6.3.so.6.3: cannot open shared object file: No such file or directory
Any idea how to resolve this? Thanks!
--camera=USB should be corrected as --usbcam
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.
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
Hi, I downloaded models.git by issuing
git clone --recurse-submodules https://github.com/tensorflow/models.git but in the other step cd /home/pi/tensorflow1/models/research I took there was no such directory error even if I checked the models folders manually. So, I can't find the research file in my folders. Can anyone help me?
When I ran " sudo pip3 install jupyter" command, I had got the below error message.
pi@raspberrypi:~ $ cat /etc/debian_version
9.8
pi@raspberrypi:~ $ cat /etc/*release*
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:~ $
. . . OMISSION . . .
Collecting nbformat>=4.4 (from nbconvert->jupyter)
Using cached https://files.pythonhosted.org/packages/da/27/9a654d2b6cc1eaa517d1c5a4405166c7f6d72f04f6e7eea41855fe808a46/nbformat-4.4.0-py2.py3-none-any.whl
Collecting jupyter-core (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/1d/44/065d2d7bae7bebc06f1dd70d23c36da8c50c0f08b4236716743d706762a8/jupyter_core-4.4.0-py2.py3-none-any.whl (126kB)
100% |################################| 133kB 236kB/s
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
six.raise_from(e, None)
File "<string>", line 2, in raise_from
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
pi@raspberrypi:~ $
i wanted to try cat-detection,
(object-detection already running fine)
disabled twilio in the script, but got this error:
root@raspimax7219:/usr/src/tensorflow1/models/research/object_detection# python3 Pet_detector.py
Traceback (most recent call last):
File "Pet_detector.py", line 275, in <module>
frame.setflags(write=1)
ValueError: cannot set WRITEABLE flag to True of this array
root@raspimax7219:/usr/src/tensorflow1/models/research/object_detection#
may you can help me out, shorthand?
dont understand the array-constrution...but you?
what to do here?
thanks,
tozett
Followed guide and everything looks good, but when I run python3 Object_detection_picamera.py I get the following:
ImportError: numpy.core.multiarray failed to import
Traceback (most recent call last):
File "Object_detection_picamera.py", line 23, in
import cv2
File "/home/pi/.local/lib/python3.5/site-packages/cv2/init.py", line 3, in
from .cv2 import *
ImportError: numpy.core.multiarray failed to import
Picamera works when I take a raspistill, but the script fails at "from picamera.array import piRGBArray" with "ImportError: No Module named 'picamera'
I'm using a virtual env, not sure if that is why.
Any ideas?
can u please fix this error sir!!
Traceback (most recent call last):
File "Object_detection_picamera.py", line 51, in
from utils import label_map_util
File "/home/pi/tensorflow1/models/research/object_detection/utils/label_map_util.py", line 21, in
from object_detection.protos import string_int_label_map_pb2
ImportError: cannot import name 'string_int_label_map_pb2'
Hello,
My framerate is 0.05 which is very. I'm running a Raspberry PI 3+
What can I do to improve the framerate ?
Hi Edje!
Trying to use a custom model, but I'm receiving an error about 'image_tensor' not existing in the graph.
KeyError: "The name 'image_tensor:0' refers to a Tensor which does not exist. The operation, 'image_tensor', does not exist in the graph."
Full console output here
I trained the model following Google's TensorFlow for Poets tutorial. The output was a .pb for the graph and a .txt with the labels. It didn't have the labels formatted the same way yours did, so manually edited it in.
Do you think something else might be missing from the retraining?
Any help would be much appreciated! Your example worked GREAT, now it's just to add in the custom model!
Thank you,
-RobotGrrl
When I push "sudo pip3 install pillow lxml jupyter matplotlib cython" I get this error:
`
Collecting defusedxml (from nbconvert->jupyter)
Downloading https://files.pythonhosted.org/packages/06/74/9b387472866358ebc08732de3da6dc48e44b0aacd2ddaa5cb85ab7e986a2/defusedxml-0.6.0-py2.py3-none-any.whl
Collecting widgetsnbextension~=3.4.0 (from ipywidgets->jupyter)
Exception:
Traceback (most recent call last):
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
six.raise_from(e, None)
File "", line 2, in raise_from
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
httplib_response = conn.getresponse()
File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 353, in run
wb.build(autobuilding=True)
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 749, in build
self.requirement_set.prepare_files(self.finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 554, in _prepare_file
require_hashes
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 278, in populate_link
self.link = finder.find_requirement(self, upgrade)
File "/usr/lib/python3/dist-packages/pip/index.py", line 465, in find_requirement
all_candidates = self.find_all_candidates(req.name)
File "/usr/lib/python3/dist-packages/pip/index.py", line 423, in find_all_candidates
for page in self._get_pages(url_locations, project_name):
File "/usr/lib/python3/dist-packages/pip/index.py", line 568, in _get_pages
page = self._get_page(location)
File "/usr/lib/python3/dist-packages/pip/index.py", line 683, in _get_page
return HTMLPage.get_page(link, session=self.session)
File "/usr/lib/python3/dist-packages/pip/index.py", line 792, in get_page
"Cache-Control": "max-age=600",
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
File "/usr/lib/python3/dist-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
File "/usr/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/usr/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
File "/usr/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
`
RPi 3B+ & using tensorflow-1.13.1-cp35-none-linux_armv7l.whl
When issueing
python3 Object_detection_picamera.py --usbcam
this error appears:
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.4 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5
return f(*args, **kwds)
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 432, got 412
return f(*args, **kwds)
How to recompile tensorflow for runtime 3.5?
Do you have SD card image that we can download and try immediately?
so that we can save time downloading and compiling?
Hi !!! I am a little bit confused !!!!
What is the difference between tensorflow object detection API and SSD Mobile net ( written in tensorflow)? are they the same thing?
How can I modify the code to make the camera detect human only. And it can trigger gpio when the number of detected human goes to certain number such as 5?
How long did you train the playing card detector model to accurately detect the playing card?
Hi, I'm trying this on my raspberry pi however I'm getting some erros that I solver but this one I cannot see what is the problem.
So, I run this pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py --usbcam
and after a while I get the camera image, but 10 sec later I got an error: pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py --usbcam /usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: compiletime version 3.4 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.5 return f(*args, **kwds) /usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: builtins.type size changed, may indicate binary incompatibility. Expected 432, got 412 return f(*args, **kwds) 2019-05-16 09:51:51.406156: W tensorflow/core/framework/allocator.cc:124] Allocation of 8640000 exceeds 10% of system memory. 2019-05-16 09:51:52.530344: W tensorflow/core/framework/allocator.cc:124] Allocation of 8640000 exceeds 10% of system memory. 2019-05-16 09:51:53.278628: W tensorflow/core/framework/allocator.cc:124] Allocation of 8640000 exceeds 10% of system memory. 2019-05-16 09:51:54.004618: W tensorflow/core/framework/allocator.cc:124] Allocation of 8640000 exceeds 10% of system memory. 2019-05-16 09:51:54.737953: W tensorflow/core/framework/allocator.cc:124] Allocation of 8640000 exceeds 10% of system memory. VIDIOC_DQBUF: No such device Traceback (most recent call last): File "Object_detection_picamera.py", line 192, in <module> feed_dict={image_tensor: frame_expanded}) File "/home/pi/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 929, in run run_metadata_ptr) File "/home/pi/.local/lib/python3.5/site-packages/tensorflow/python/client/session.py", line 1121, in _run np_val = np.asarray(subfeed_val, dtype=subfeed_dtype) File "/home/pi/.local/lib/python3.5/site-packages/numpy/core/numeric.py", line 538, 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
The error is every time something _REQBUFS, I fond out if I lower the image sizer I can get this working very well but the problem is with an image size 150x150 I can not see nothing and all the fun is lost.
with a size 200x200 or high I got the error No such device
with a size 150x150 or low everything work great.
Why????
Any idea???
Its just me???
Can I solve it???
Thanks
I have tested a similar code( Tensorflow SSD model on my raspberry pi with dlib tracker) on my raspberry pi and it works fine but it is still slow. so I decide to use NCS movidius... Have you tried it? where should I start?
ValueError: NodeDef mentions attr 'Truncate' not in Op<name=Cast; signature=x:SrcT -> y:DstT; attr=SrcT:type; attr=DstT:type>; NodeDef: Postprocessor/ToFloat_2 = CastDstT=DT_FLOAT, SrcT=DT_INT32, Truncate=false. (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.)
I initially had several problems when running the rasp models, because in TF 1.1 it was possible to run in rasp, but the models were large and always exceeded memory, with its tutorial and the new tflite models I finally got.
My tip is: when exporting the graph, do it in rasp, because I tried to export the graph on the pc I trained and when I load it in rasp I get the following error: graph._c_graph, serialized, options) # pylint: disable = protected-access
tensorflow.python.framework.errors_impl.NotFoundError: Op type not registered 'NonMaxSuppressionV3' in binary running on raspberrypi. Make sure the Op and Kernel are registered in the binary running in this process.
Hi all.
Follow all the tuts and some workaround.
Able to complete all tutorial with less error.
But when i issue
sudo pyhton3 object_detectionetcetc.py
I got this error
"cannot connect to X server"
Any work around on this?
Been struggling for 3 days with this.
Setup :
Pi camera
Rpi b+
My living room samsung tv via hdmi to rpi (headless)
Did test take picture manually is ok
Did test take video manually is ok
Did test with keyboard usb with hdmi tv screen upon booth up
So far i m only SSH to rpi b+ via laptop(windows) & ssh via android phone.
After
python3 Object_detection_picamera.py
raspi hang after few seconds, but the framerate is around 1.3fps
I used Tensorflow - 1.11.0 and Protocol Buffers v3.6.1.
This is my 2nd SD card having different error..
The 1st had a different error
pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py
Traceback (most recent call last):
File "Object_detection_picamera.py", line 23, in <module>
import cv2
File "/home/pi/.local/lib/python3.5/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: libcblas.so.3: cannot open shared object file: No such file or directory
pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py --usbcam
2019-02-01 01:25:45.681330: W tensorflow/core/framework/allocator.cc:122] Allocation of 2764800 exceeds 10% of system memory.
2019-02-01 01:25:47.063722: W tensorflow/core/framework/allocator.cc:122] Allocation of 2795520 exceeds 10% of system memory.
2019-02-01 01:25:48.364439: W tensorflow/core/framework/allocator.cc:122] Allocation of 2795520 exceeds 10% of system memory.
2019-02-01 01:25:49.651463: W tensorflow/core/framework/allocator.cc:122] Allocation of 2795520 exceeds 10% of system memory.
2019-02-01 01:25:51.249713: W tensorflow/core/framework/allocator.cc:122] Allocation of 2795520 exceeds 10% of system memory.
: cannot connect to X server
I did everything as per you said and everything worked fine, everything was exactly the same as you did! But when i execute the last instruction for opening the camera and identify the objects the pi just hangs and reboots. I also made sure that nothing except the terminal was working. Please help!
Great tutorial this far. My only mistake, not reading to the end before.
Instead of using a camera as source, I wanted to provide existing images as input, resulting in a copy with drawn rectangles where recognition successed.
Is this possible with the given code? In my level of understanding, the basic functionality should be the same. For a camera as input, there only is a wrapper that extract singles images and calls a function?! Or is it done by video stream as input?
Based on I trained a model to detect 3 labels. I have exported the model and transferred it to Raspberry pi as per . However, when I run the new model the raspberry pi hangs.
Please note:
New model has a frozen inference graph of 48MB and was trained on Faster-RCNN-Inception-V2 model.
Kindly advise best way forward to enable the model to run as expected.
Thanks
IMPROVEMENT:
Depending on which RPi the instructions are being executed on, it's possible to cut down the build time by using
make -j4
make check -j4
instead of
make
make check
On my RPi 3B+, "make check -j4" took only 50 minutes as opposed to 107 minutes as mentioned in the instructions.
HTH
test this:Tutorial to set up TensorFlow Object Detection API on the Raspberry Pi
I ran the program successfully, showing the video, but I did not recognize the result and bbox.
and test simple code:
import tensorflow as tf
happy= tf.constant('Happy new year!')
sess = tf.Session()
sess.run(happy)
tensorflow works well
I trained 2 different models on top of the ssdlite_mobilenet_v2_coco from the tensorflow object api model zoo, but I get different speeds on each model when running on the Raspberry Pi 3:
ssdlite_mobilenet_v2_coco (90 classes) = 1.3 fps
retrained_ssdlite_1 (2 classes) = 0.7 fps
retrained_ssdlite_2 (3 classes) = 0.8 fps
My trained models are experimenting an drop of almost half the speed of the original model
Is anybody having the same issue?
Am I missing some step to make the model efficient at inference time?
It's strange.
The "pip3 install opencv-python" command generates a error message as following:
pi@raspberrypi:~ $
pi@raspberrypi:~ $ pip3 install opencv-python
Traceback (most recent call last):
File "/usr/bin/pip3", line 9, in <module>
from pip import main
ImportError: cannot import name 'main'
pi@raspberrypi:~ $
pi@raspberrypi:~ $ cat /etc/debian_version
9.8
pi@raspberrypi:~ $ cat /etc/*release*
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
pi@raspberrypi:~ $
When this command is entered while in /tensorflow1/models/ it deletes all previous downloaded files in models/research with exception of syntaxnet. I think this isnt the desired effect? Right? If I am correct, how what would I be doing wrong thus the result. I choose to ignore the message, wise choice? Thanks
tried doing the Tensorflow from both MagiPi web site and from GitHub. In both cases, during the "make" steps for tensorflow I would get error messages saying the libraries libxml2 and libxslt could not be found.
I did a dpkg get-selection and found these files were known to my packages. However, whenever I tried to build a sample file that needed either of them, gcc would give an error that these files were not found.
I then went to www.xml.org to get the sources to these files (they are not loaded by sudo apt-get install at all). Here is how to compile them:
http://xmlsoft.org/FAQ.html
Take the latest and greatest of libxml2 and libxslt found in their resources and then use the ./configure and make and make install to get them into your RaspberryPi system. Once those two libraries were build and installed, then everything else in the GitHub process worked.
tjcooper
Hi,
This project is really interesting but some how i am struggling from last 2 days and getting this error every time.
tensorflow-1.10.0-cp35-none-linux_armv7l.whl is not a supported wheel on this platform.
Storing debug log for failure in /root/.pip/pip.log
My raspberry is running on version "jessie desktop".
Please help me to resolve it.
Regards
Devraj
i did everything as in dokumentation.
if i run object_detection_picamera.py i got this error.
ImportError: libgstbase-1.0.so.0: cannot open shared object file: No such file or directory
any hint what is missing?
thanks a lot
How would you run a variation of the model to count objects moving down a surface? Fairly new to object detection.
I would like to edit the code to
Heya
I'm trying to run the command "python3 Object_detection_picamera.py " and I keep getting the this stack being returned:
Traceback (most recent call last):
File "Object_detection_picamera.py", line 23, in <module>
import cv2
File "/home/pi/.local/lib/python3.5/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
ImportError: libImath-2_2.so.12: cannot open shared object file: No such file or directory
I have followed all the instructions and just wondering what is the problem - have I missed something or is there something else that I need to install?
Thank you
Osian
pi@raspberrypi:~/tensorflow1/models/research/object_detection $ python3 Object_detection_picamera.py
Traceback (most recent call last):
File "Object_detection_picamera.py", line 137, in <module>
frame.setflags(write=1)
ValueError: cannot set WRITEABLE flag to True of this array
Hi,
After I run the script, it took around 20 seconds to start and then a white screen appear.
https://ibb.co/hRKUqq
Note: I am new to TensorFlow.
Thanks;
Thank you for the tutorial. I'll preface this by saying that I'm a complete novice with TensorFlow/object detection, so apologies if what I'm saying doesn't make sense.
Is there a way to easily adapt this code to make it work with TensorFlow Lite?
I've gotten it to work with normal TensorFlow and the ssdlite_mobilenet_coco_v2 model. On hand I have the converted .tflite file for the .pb file in the ssd_mobilenet_v2_quantized_300x300_coco model. Any help would be greatly appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.