TFLite export - Input and output nodes
Hi there,
I am trying to export a model to a TensorFlow Lite or preferably CoreML. For both, it is required to first convert the model to a frozen_model (.pb format). To do this I have already managed to extract a .pbtxt file from the session graph, which is required for the tensorflow.python.tools.freeze_graph function. The issue I am currently facing is that I need to specify the output_node_names variable which I do not know. And after this step, I would also need to figure out the input node name and shape for the conversion to CoreML.
Could anyone perhaps tell me which nodes are the input and output nodes and what their shapes are, or how I could find these?
Thanks in advance!
TFLite conversion documentation: https://www.tensorflow.org/lite/convert/ tf-coreml documentation: https://github.com/tf-coreml/tf-coreml
Hey @houtzager :
The inputs are these four placeholders and the three iterators below: https://github.com/jfkirk/tensorrec/blob/master/tensorrec/tensorrec.py#L273
There are many different output nodes for different purposes. The most straightforward of the outputs is here: https://github.com/jfkirk/tensorrec/blob/master/tensorrec/tensorrec.py#L662
If you go through the other predict* API methods, you'll find the other output nodes.
Hope this helps!
Hi @jfkirk ,
First of, thanks for your response.
Assuming you only need to specify a list of user and item features I find it a bit strange that for example properties like alpha and an interaction iterator are input nodes. Aren’t these variables meant for training the model instead of making the predictions?
After trying to get this export to work for quite some time I’ve decided to move on to another solution, so this issue may be closed.
Hi @houtzager
Interested in this topic. Did you find a different solution to export to TF Lite or a whole different framework to achieve the same result?
Thanks.