Problem: How can i convert a .tflite
(serialised flat buffer) to .pb
(frozen model)? The documentation only talks about one way conversion.
Use-case is: I have a model that is trained on converted to .tflite
but unfortunately, i do not have details of the model and i would like to inspect the graph, how can i do that?
I found the answer here
We can use Interpreter to analysis the model and the same code looks like following:
Netron is the best analysis/visualising tool i found, it can understand lot of formats including
.tflite
.I have done this with TOCO, using tf 1.12
(you can remove the dump_graphviz option)
I don't think there is a way to restore tflite back to pb as some information are lost after conversion. I found an indirect way to have a glimpse on what is inside tflite model is to read back each of the tensor.
and you would see something like below. As there are only limited of operations that are currently supported, it is not too difficult to reverse engineer the network architecture. I have put some tutorials too on my Github