Apply Tensorflow model on pynq?

Hello everyone,

I have just trained a model using Tensorflow in my PC and I would like to apply it on my PYNQ-Z2. However, I found that Tensorflow 1.0+ versions cannot be installed on PYNQ-Z2, and I also failed to install opencv-contrib.

Is there any way for us to load and run a Tensorflow model on PYNQ-Z2? Or do I need to buy a Ultra96?

1 Like

Tensorflow is too heavy to install but tflite should be working. Personally I tried tflite and it is working on one of our boards (you perhaps need bazel, but I don’t remember).

@nfmzl @rock

Despite that this is a Pynq-Z2, is another option to leverage DPU-PYNQ in conjunction with TVM, assuming that nfmzl can port DPU-PYNQ to the Z2?

https://github.com/Xilinx/Vitis-AI/tree/master/tvm

You should also be able to consider use of the TVM runtime / compiler with no DPU. I would assume that in this context you would use the TVM main repository (see tvm.ai) to directly target the A53 for inference acceleration.

TVM solves the problem of deployment of models that originate from framework versions that are not supported directly in Vitis-AI, and should likewise solve the problem of TF compatibility with PYNQ.

My 2 cents…
–Quenton

Hello, could you tell me which version of tflite you are running? I’m currently trying to run tflite_runtime-2.5.0 on the PYNQ-Z2 V2.5 image but the interpreter is unfortunatly not running correctly (Illegal Intruction on invoke).
Thanks in advance

I don’t remember the version, but it should be much less than 2.5.0. There is a bazel package in sdbuild folder on PYNQ github, I think I used the version compatible with that bazel package.

Hello @thomasvz I am facing a similar issue with PYNQ Z1 v2.7 image on interpreter.invoke did you find any solution?
Thank you in advance!