PyTorch and TensorFlow Lite

One of the challenges of software is understanding the available software camps enough to chose which to invest your time with. While developing machine learning models is a bit beyond the RaspberryPi, running completed models on the RaspberryPi 3B can actually reduce execution load.

Case in point - I tested non-ML speech recognition on an original Pi versus the Pi3B and discovered the Pi3B to be very capable for both grammar based and small natural-language based applications when the majority of the processor could be dedicated to the task.

In building Carl, I wanted to add speech recognition to his capabilities, but could not dedicate enough processing resources for full time speech recognition. The answer? Trained machine learning for continuous word spotting listening for “Hey Carl”. Machine learning took the processor load down from 25% of the Pi3B (1 whole core) to just 5% (1/5th of one core).

Another case where machine learning has made strong inroads on our RaspberryPi processors and even to the GoPiGo3 is using the PiCamera with pre-built ML models for computer vision.

Deciding you want to learn to use machine learning requires choosing one of the popular engines and methodologies. You can start learning on the GoPiGo3 and GoPiGo OS with the included TensorFlow-lite demo, and might then choose to expand your learning in the TensorFlow/TensorFlow-lite “machine learning camp”.

BUT today I read that academia and folks that prefer to code in Python, are trending toward PyTorch now:

[PyTorch is better for students and research

PyTorch has a reputation for being appreciated more by academia. This is not unjustified; three out of four research papers use PyTorch. Even among those researchers who started out using TensorFlow — remember that it arrived earlier to the deep learning party — the majority have migrated to PyTorch now.](Why TensorFlow for Python is dying a slow death)

The whole ML subject is a bit of a rabbit-hole for robot builders, and with “affordable” advanced vision sensors starting to be supplied on RaspberryPi4 based robots such as the TurtleBot4, the choice of TensorFlow or PyTorch is most important for folks wanting to customize or develop new ML models specific for their robot’s environment and functionality.

Hopefully, someone new will land here with a “Using PyTorch on the GoPiGo3” tutorial so we can all gain exposure to this exciting use of a PiCamera attached to the GoPiGo3.

UPDATE: Then there are great, fun, quick, YouTube videos that go so fast through coding with ML in Python they make your face spin:


Having read the article, I am tempted to call it “click-bait” since it is obvious - even within the article’s context - Tensor Flow isn’t dying, it’s just maturing and it has a large ecosystem outside of Python.

i.e.  If you want to do something significant in anything other than Python, Tensor Flow is your daddy.


True it has matured. I agree with the article that Tensor Flow is slowly on the way out. (It actually might be argued that the whole technology, as it stands today, is on the way out based on the pull back of ML investment in the last two quarters.)

It would do well for every student thinking of pursuing software as a career, and planning to pass through the software education “machine” to start their ML learning running the pre-installed Python TensorFlowLite demo in GoPiGo OS.

Reading the article felt like insight for students interested in learning about ML - in education (at the moment) Python is major and growing, while TensorFlow is major and diminishing in education usage. My point in bringing the article here was to highlight a trend for students that wander here via the GrovePi or GoPiGo3.

If I was looking for a job right now, then Keras is “old”, TensorFlow is the right now. ModRobotics focus seems to be on early education rather than adding resume fodder, so it was surprising actually to see the TensorFlowLite demo in GoPiGo OS.


Wow - amazing how easy they’ve made things now. Thanks for the video link