Tensorflow and keras on pynq z2

I want to try the classification on pynq z2 by following: https://github.com/ZhaoqxCN/PYNQ-CNN-ATTEMPT/tree/master/Ultrasound-Image-Classification-CNN
It needs keras which internally needs tensorflow. I could install keras somehow but dont know what to do for tensorflow.

After searching on forum, I could see people tried installing it previously also btu could not find any working solution.
So, can anyone help with this now.

Hi there,

I don’t think tensorflow has official support for arm32 on the Z2, so you’d have to compile it from source. I’ve not tried it but might be worth looking into tensorflow-lite for this as well as that is supposed to play nicely with arm processors.


1 Like

Hi Sir, I am having model.tflite (Tensorflow flow lite model). I want to run it on PYNQ-Z2 Board which is of 32 bit . I am struck at Bazel commands in implemening it. When I use command:
bazel build --config=elinux_armhf -c opt model1.tflite
I am getting error as
ERROR: Config value ‘elinux_armhf’ is not defined in any .rc file
Could you please help in this?

Hi @Nitw123456,

I’m not very familiar with bazel so can’t advise too much. There seem to be similar issues to your error raised on the tensorflow issue tracker. Maybe you will find an answer searching those issues.


Hi Sir,

SHall I know how you implemented tflite inference model on PYNQ-Z2 32bit arm. Atpresent , I am having model.tflite which I generated from .h5 file. Shall you suggest me in this?