TensorFlow Lite 2 Setup Problems

Moderators: adafruit_support_bill, adafruit

Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/
User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

I have a Raspberry Pi 4 B and a Braincraft HAT. I am following the Adafruit TensorFlow Lite 2 Setup https://learn.adafruit.com/running-tens ... te-2-setup.

In the "Install rpi-vision" section, after "pip3 install -e .", I encountered this problem -

error: subprocess-exited-with-error
x python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [12 lines of output]

Below are the Python and pip versions.
(.venv) chinpaijong@BBPi1:~/rpi-vision $ python --version
Python 3.9.2
(.venv) chinpaijong@BBPi1:~/rpi-vision $ pip --version
pip 22.0.4 from /home/chinpaijong/rpi-vision/.venv/lib/python3.9/site-packages/pip (python 3.9)

Please help.
Attachments
Untitled.jpg
Untitled.jpg (266.11 KiB) Viewed 245 times

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: TensorFlow Lite 2 Setup Problems

Post by mikeysklar »

Do yo have a development version of SDL installed? It could be an environment variable being lost due to the use of venv, but based on another forum post I’d try to just installed these packages and see it `pip install -e` works.

Code: Select all

 sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

Hi,
Thank you for your quick response. Those packages seemed to have made good progress. Now this is where I got stuck.

Missing dependencies

Hunting dependencies...
SDL : found 1.2.15
FONT : found
IMAGE : found
MIXER : found
PNG : found
JPEG : found
SCRAP : found
PORTMIDI: not found
PORTTIME: not found
FREETYPE: found 23.4.17
Attachments
Untitled.jpg
Untitled.jpg (226.32 KiB) Viewed 230 times

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: TensorFlow Lite 2 Setup Problems

Post by mikeysklar »

Full command from this forum thread. This should help with the fonts.

Code: Select all

 $ sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev   libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev
https://stackoverflow.com/questions/765 ... for-pygame

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

Hi, I tried that and got "Package 'python-numpy' has no installation candidate".

Consequently, my "pip3 install -e ." still ended up with
PORTMIDI: not found
PORTTIME: not found
Attachments
Untitled.jpg
Untitled.jpg (104.59 KiB) Viewed 219 times

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: TensorFlow Lite 2 Setup Problems

Post by mikeysklar »

I can probably figure out the python-numpy and PORTMIDI/PORTTIME messages, but first we should probably back up.

Which release of Pi OS do you have installed? Has it been updated? Was it Lite or Full?

Do you see the same issues when you try to run these command not in a `venv`?

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

First let me say thank you. You have been very engaging in helping me solve my problems.

To answer your questions, I run version 11 bullseye (I attached a full screen shot). It has been updated almost daily. It is a full version. To be certain, I just updated it again after receiving your response, and tried to run those commands. But still got stuck on the same problem.

I run the commands outside the venv virtual environment and see the same issue.
Attachments
Untitled.jpg
Untitled.jpg (94.01 KiB) Viewed 214 times
Pi OS Version.jpg
Pi OS Version.jpg (56.12 KiB) Viewed 214 times

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: TensorFlow Lite 2 Setup Problems

Post by mikeysklar »

Your getting there. I think we need to focus on python3 package install types. Try this for numpy:

Code: Select all

sudo apt install python3-numpy

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

Hi,

I tried "sudo apt install python3-numpy" then come back to install the previous packages, but still got this problem "Package 'python-numpy' has no installation candidate".
Attachments
numpy.jpg
numpy.jpg (159.07 KiB) Viewed 195 times

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: TensorFlow Lite 2 Setup Problems

Post by mikeysklar »

The long string of packages to install contains python-numpy. Just change that or omit it. Here is the same list of packages, but using python3-dev and python3-numpy.

Code: Select all

sudo apt-get install python3-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev   libsdl1.2-dev libsmpeg-dev python3-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

Hi,

I have installed these packages. It would seem that I have moved beyond this step.

Next step

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

Hi,

I have installed these packages. It would seem that I have moved beyond this step.

Next step
Attachments
Error3.jpg
Error3.jpg (62.05 KiB) Viewed 187 times
Error2.jpg
Error2.jpg (75.29 KiB) Viewed 187 times
Error1.jpg
Error1.jpg (144.93 KiB) Viewed 187 times

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

It would not let me upload doc or txt files. If you would like to see the entire terminal log please let me know. I'll just paste the whole text here.

User avatar
mikeysklar
 
Posts: 14194
Joined: Mon Aug 01, 2016 8:10 pm

Re: TensorFlow Lite 2 Setup Problems

Post by mikeysklar »

I believe the package you want to install is python3-pygame.

Perhaps the core issue here is that you are running pip instead of pip3 along the same lines python 2.x instead of python 3.x packages.

From the Adafruit guide on TensorFlow 2 Lite Setup:

https://learn.adafruit.com/running-tens ... -3038659-2

Code: Select all

sudo apt-get install -y libatlas-base-dev libhdf5-dev libc-ares-dev libeigen3-dev build-essential libsdl-ttf2.0-0 python3-pygame festival python3-h5py

Code: Select all

pip3 install virtualenv Pillow numpy pygame

User avatar
chinpaijong
 
Posts: 13
Joined: Mon Jun 06, 2022 10:36 pm

Re: TensorFlow Lite 2 Setup Problems

Post by chinpaijong »

Hi,

This did not help. I am still stuck at where I was. Same errors as before.

Locked
Forum rules
Talk about Adafruit Raspberry Pi® accessories! Please do not ask for Linux support, this is for Adafruit products only! For Raspberry Pi help please visit: http://www.raspberrypi.org/phpBB3/

Return to “Adafruit Raspberry Pi® accessories”