fastmachinelearning / hls4ml

Machine learning on FPGAs using HLS
https://fastmachinelearning.org/hls4ml
Apache License 2.0
1.19k stars 390 forks source link

Dataflow issue with a CNN implementation on PYNQ-Z2 #776

Open AKaronen opened 1 year ago

AKaronen commented 1 year ago

Prerequisites

Please make sure to check off these prerequisites before submitting a bug report.

Quick summary

CNN implementation on Pynq-Z2 doesn't seem to pass the data through the board correctly. Running NeuralNetworkOverlay.predict() on the board gets stuck after debug logs "Transfer OK". The model is "Resource" optimized with hls4ml due to lack of resources on the Pynq-board.

Details

CNN model created with Tensorflow/Keras and somewhat follows the hls4ml-tutorials CNN-implementation notebook. Pynq version 2.6., hls4ml version 0.7.0, Vivado 2020.1.

Expected behavior

Neural network Overlay runs prediction normally.

Actual behavior

Prediction gets stuck after debug message "Transfer OK".

Additional context

I had problems even fitting a CNN on the PYNQ-Z2 board with hls4ml. It might just be an resource issue and the implemented neural network isn't working because of that. I'm new to FPGA-development so I don't quite grasp the transformation process and what's done behind the APIs when I build and generate the bitfiles for the board.