Debugging in C++ codes

70 views
Skip to first unread message

Alex Jiang

unread,
Aug 3, 2021, 8:35:06 PM8/3/21
to TensorFlow Lite
Hi all,

I am trying to explore the detailed information in C++ codes for post training quantization. But when I started step-by-step debugging, I can only reach TocoConvert
in tensorflow/lite/python/wrap_toco.py:32 and can not step in to this API. I was wondering if anyone has any suggestions? 

Also, if this can not be done, is there any solution to convert a model (.ckpt) to a tflite model using C++?

Thank you!

Jaesung Chung

unread,
Aug 3, 2021, 9:02:51 PM8/3/21
to TensorFlow Lite, alexji...@gmail.com
Hi,

For the .ckpt conversion, we provide the saved model conversion API through tf.lite.TFLiteConverter.from_saved_model (link). Please load the saved model with checkpoints by using the TensorFlow APIs and then, convert the loaded saved model to the above converter API.


Best regards,
Jaesung

Alex Jiang

unread,
Aug 3, 2021, 9:25:45 PM8/3/21
to TensorFlow Lite, Jaesung Chung
Hi Jaesung, 

Thank you for your information! 
I have converted the model using  API through tf.lite.TFLiteConverter.from_saved_model. I just wonder if there is any solution to convert by C++ or call functions in C++ codes, since I really curious about the dataflow.


Best,
Alex

Jaesung Chung

unread,
Aug 3, 2021, 9:30:50 PM8/3/21
to Alex Jiang, TensorFlow Lite
Hi Alex,

Good to hear that the conversion has succeeded already.

There are no official APIs for the TFLite converter layer in the C++ level. However, if you would like to know about the conversion process details, you can check out the TensorFlow Lite MLIR converter here.

Best regards,
Jaesung

Alex Jiang

unread,
Aug 3, 2021, 9:37:21 PM8/3/21
to TensorFlow Lite, Jaesung Chung, TensorFlow Lite
Hi Jaesung,

I will do that. Thank you so much!

Best,
Alex
Reply all
Reply to author
Forward
0 new messages