Hi tflite team and friends,
I got a task which requires inserting a sub-graph to a converted tflite model file.
According to tflite schema.fbs (
https://github.com/FrozenGene/tflite/blob/master/schema.fbs) file, the model file contains a list of sub-graphs in which the first sub-graph is typically the main model. So I'm thinking about how to directly insert sub-graphs into the tflite model without using Tensorflow model and tflite converter.
To be more detailed, my client would like to have the following steps:
1. Initially, I have a converted tflite model file and I know it's input, output details and some hidden layers.
2. I build a graph by tf.function which takes one hidden layer output tensor as input and gives output tensor to the next layer of the hidden layer.
3. I insert the graph to the inception_v3.tflite and repackage them together as a new tflite file.
How to insert a sub-graph into the converted tflite file? I know it's doable if I do sub-graph insertion with keras/tensorflow models. For example, it's easy to insert a keras/tensorflow graph/sub-graph into the keras/tensorflow model and then convert the combined model to tflite file. But my client just provides a tflite model file. But they don't want to provide their keras/tensorflow model files to me. So I have to try to insert a sub-graph into the tflite file. By the way, I can get the architecture and input/outputs by Netron (
https://github.com/lutzroeder/netron).
Thanks for the reply,
Simon