Steps to add pycoral, tflite-runtime and edgetpu

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Steps to add pycoral, tflite-runtime and edgetpu

4,043 Views
krsuresh
Contributor III

Hi,

We would appreciate it if you could tell us how to build a core-minimal-image with pycoral, tensorflow-lite, and edgetpu.

Thanks,
Sureshkumar R

0 Kudos
Reply
8 Replies

3,900 Views
krsuresh
Contributor III

Hi @Dhruvit,

Hope you are doing well.

Thank you very much for your support. Now, I am doing pycoral build for python3.10 with help of coral team.

 

Thanks & Regards,

Sureshkumar R

0 Kudos
Reply

3,894 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @krsuresh,

I am glad to help you in this case.

can I mark this case as close?

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

3,889 Views
krsuresh
Contributor III

Hi @Dhruvit 

Yes, you can thank you so much for response.

 

Thanks & Regards,

Sureshkumar R

0 Kudos
Reply

4,007 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @krsuresh,

I hope you are doing well.

Please add the below line in local.conf file.

IMAGE_INSTALL:append = "  tensorflow-lite python3-pycoral libedgetpu" 

I.MX BSP only contains a recipe for tensorflow-lite.

For pycoral and edgetpu , one needs to add custom recipes (.bb file)
One can refer to the below-mentioned recipes to create a custom one for yocto BSP.

https://github.com/digi-embedded/meta-digi/blob/gatesgarth/meta-digi-arm/recipes-bsp/libedgetpu/libe...

https://github.com/digi-embedded/meta-digi/blob/gatesgarth/meta-digi-dey/recipes-devtools/python3-py...

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

3,996 Views
krsuresh
Contributor III

Hi @Dhruvit,

I appreciate your kind response so much.

The "tensorflow-lite libedgetpu" has now been successfully added. There are only a few issues with pycoral alone. I would appreciate your assistance with this as well.

Issue1: cannot stat '/home/rnd/Project/Mydog/build-flexxon-mydog/tmp/work/armv8a-poky-linux/python3-pycoral/1.0.1-r0/git/test_data/*': No such file or directory

To generate model and label, I can run "bash install_requirements.sh classify_image.py", but it does not appear to have been executed in the receipe, so no files are in the test_data folder.

Issue2:Attempting to build bitake python3-coral with manually generated models and labels (bash install_requirements.sh classify_image.py) but facing the following problem.

"ERROR: pycoral-1.0.1-cp38-cp38-linux_aarch64.whl is not a supported wheel on this platform."

According to our analysis, this issue occurred because the pycoral wheel version was higher than the tag version supported.

#pip3 debug --verbose
.................................
...............................
Compatible tags: 496
  cp310-cp310-manylinux_2_35_aarch64                       
  cp310-cp310-manylinux_2_34_aarch64                      
  cp310-cp310-manylinux_2_33_aarch64

0 Kudos
Reply

3,952 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @krsuresh,

I hope you are doing well.

Yes, this issue occurred due to the pycoral wheel version not maching python version in the yocto release.

pycoral has not released wheel package for aarch64-linux python 3.10 version yet.

Available wheel release for various python version tags is available below.

google-coral/pycoral

Customers can use the yocto version which supports python3.9 (e.g hardknott) or change preffred python version to 3.9 (which is trivial task.)

& update python3-pycoral recipes to python3-pycoral_2.0.0 version,(and use pycoral-2.0.0-cp39-cp39-linux_aarch64.whl )

Thanks & Regards,
Dhruvit Vasavada 

0 Kudos
Reply

3,934 Views
krsuresh
Contributor III

Hi @Dhruvit,

Thank you very much for your kind words. Hope you are doing well.

Since hardknott doesn't support .NET, I cannot move from krikstone to hardknott.

Could you please tell me if there's a way to change the Python version in Krikstone to 3.9?

The following options have been tried for python version change, but I am encountering build warnings,

PREFERRED_VERSION_python3 = "3.9"

WARNING: preferred version 3.9 of python3 not available (for item python3)
WARNING: versions of python3 available: 3.10.9
WARNING: preferred version 3.9 of python3 not available (for item python3)
WARNING: versions of python3 available: 3.10.9
WARNING: preferred version 3.9 of python3 not available (for item python3-resource)
WARNING: versions of python3 available: 3.10.9
WARNING: preferred version 3.9 of python3 not available (for item python3-terminal)
WARNING: versions of python3 available: 3.10.9
WARNING: preferred version 3.9 of python3 not available (for item python3-smtpd)
WARNING: versions of python3 available: 3.10.9

............

............

0 Kudos
Reply

3,914 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @krsuresh,

I hope you are doing well.

As the Python version is tied to a specific version of Yocto, It is a difficult task to change the Python version in the yocto setup.

However, One can try referring commit below for changing the python version.

https://git.congatec.com/yocto/poky/-/commit/cb02ecb507ddad3cb17c78020b42c004aa2903ae

Meanwhile, One can ask the pycoral maintainer about the availability of the wheel package for the 3.10 version of Python.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply