Unable to convert Keras model to FINN #531
Unanswered
jacopoabramo
asked this question in
Q&A
Replies: 1 comment
-
Hi @jacopoabramo, FINN only supports fully quantized models, so normal Keras models cannot be executed on a conceptual level. In the future we are planning to support QKeras, in collaboration with our colleagues at hls4ml. However, the export in QKeras is not yet ready, but you can read more about these plans in our blog post about QONNX here: https://xilinx.github.io/finn//2021/11/03/qonnx-and-finn.html And if you don't want to wait for the export path to be ready, then you could give hls4ml a try which supports Keras and QKeras models natively. Cheers, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings,
I have a small Keras model which I converted to the ONNX format using the tf2onnx package, and wanted to use FINN to generate an equivalent IP for my PYNQ-Z2. The model is really simple and it has only 3 layers. This is the original model in the ONNX format:
The input and output are noted as
unk__6x4
andunk__7x3
respectively, which I'm not exactly sure what it means or if this concerns how FINN then translates the model to the IP. In order to make sure that the input and output models had a defined dimension I applied the following code to change the dimensions:And this changed the model as follows.
As you can see now the dimensions are 1x4 for the input and 1x3 for the output, which is what I expect.
After this change I tried to replicate the notebook
tfc_end2end_verification
using this model as input. Up until the Streamlining point everything goes well and as expected. But when I try to prepare the model for the HLS conversion I obtain the following:As I don't see any
StreamingFCLayer_Batch
as reported in the example notebook, I'm wondering if I'm doing something wrong or my model is just not suitable to be converted via FINN. If somebody has any input regarding this it would be greatly appriciated.I understand that this is a really simple and small model but it is my first attempt to experiment with FINN and to get familiar with the framework.
Thank you for your attention.
Beta Was this translation helpful? Give feedback.
All reactions