Training or Inferencing Tensorflow Model on Pynq Z2

I am working on the implementation of the Tensorflow model and its accelerator using Pynq2. I have trained the model on Ubuntu 18 machine with Tensorflow Version 2.6.0. The hardware part is working fine on Pynq2 but when I train to load the model on Pynq2 it gives the following error:

Model Input: Tensor(“input_1:0”, shape=(None, 83, 83, 1), dtype=float32)
Illegal instruction

The illegal instruction occurred when I called the function Conv2D. On Pynq the version of TensorFlow is 2.1.0. I tried training the model on Pynq Z2 only but it gave the same error. The model summary is shown below. If I comment the first Conv2D call and pass the value to the next Pool then it works for MaxPool2D and stops for the next Conv2D.
Layer (type) Output Shape Param # Connected to

input_1 (InputLayer) [(None, 83, 83, 1)] 0


conv2d (Conv2D) (None, 83, 83, 16) 160 input_1[0][0]


max_pooling2d (MaxPooling2D) (None, 42, 42, 16) 0 conv2d[0][0]


conv2d_1 (Conv2D) (None, 42, 42, 8) 1160 max_pooling2d[0][0]


max_pooling2d_1 (MaxPooling2D) (None, 21, 21, 8) 0 conv2d_1[0][0]


conv2d_2 (Conv2D) (None, 21, 21, 8) 584 max_pooling2d_1[0][0]


conv2d_transpose (Conv2DTranspo (None, 42, 42, 12) 876 conv2d_2[0][0]


concatenate (Concatenate) (None, 42, 42, 20) 0 conv2d_transpose[0][0]
conv2d_1[0][0]


conv2d_3 (Conv2D) (None, 42, 42, 16) 2896 concatenate[0][0]


conv2d_transpose_1 (Conv2DTrans (None, 84, 84, 14) 2030 conv2d_3[0][0]


cropping2d (Cropping2D) (None, 83, 83, 14) 0 conv2d_transpose_1[0][0]


concatenate_1 (Concatenate) (None, 83, 83, 30) 0 cropping2d[0][0]
conv2d[0][0]


conv2d_4 (Conv2D) (None, 83, 83, 3) 813 concatenate_1[0][0]


conv2d_5 (Conv2D) (None, 83, 83, 3) 12 conv2d_4[0][0]

I have installed Tensorflow for Python 3.7 using the link: Releases · lhelontra/tensorflow-on-arm · GitHub
Any suggestion?

An example MNIST based on PYNQ 2.7:

1 Like

Hi
May I ask if there is an installation tutorial for tensorflow2.4? How to operate after the installation package is downloaded?