Closed rallen10 closed 2 years ago
Does the conversion tool nntool
support recurrent neural networks?
I am asking because the error seems to be caused by an CONCATENATION
op. There is no such op in the LTCCell definition but it is often used to implement RNNs.
Were you able to convert a LSTM or a vanilla RNN with nntool
?
Good question. Let me try to train a vanilla RNN and see if I can make the conversion
@mlech26l good catch. The same problem arises when I try to use a keras.layers.LSTM
model. Therefore it seems the problem is on the gap_sdk/nntool
side of things, not keras-ncp
. I will close this issue for now; thank you for the help.
For posterity, I tried both keras.layers.LSTM
and keras.layers.SimpleRNN
, both producing the same error as above (with a slightly different node of CONCATENATION_0_8
)
Glad I could help
I am working to port a NCP model to a micro-robotics platform; specifically a GAP8 processor onboard the Crazyflie AI-Deck. The GAP8 developers have provided a toolset and workflow for porting keras
.h5
models into format that can be run onboard the GAP8 processor, however I can't get it to work with a keras-ncp model.I can successfully convert my trained model to
.tflite
using a slightly modified version ofh5_to_tflite.py
. However, when I attempt to open the.tflite
model withnntool
, I get the errorI've opened an issue with the GAP8 developers in the hopes the problem (and fix) might be on their side (see here), however I am also opening an issue here because it is not clear where the fundamental problem lies. My suspicion is that the incompatibility lies in the LTCCell definition, but I don't know enough about either codebase to debug it on my own.