TensorflowLite_converter from python to C 
Hi **@hpssjellis** 

TensorFlow Lite converters are not directly convertible into C/C++ code from Python. And TensorflowJS also not directly convertible into C/C++.

However, you can convert the models (once they're generated) into WebAssembly (WASM) using Emscripten and run them in a browser via JavaScript.

For a simple 3 dense layer model, you can create the model using a deep learning library, then convert it to TensorFlowLite or TensorFlow.js using their respective converters. Once you have the model in the appropriate format (.tflite for TensorFlowLite or in the case of TensorFlow.js, as a set of JavaScript files or JSON format), you can then explore the use of Emscripten to compile the model into WebAssembly.

Thank you!

 @Venkat6871 That is really interesting that a tFlite file can be converter to WASM. I will look into that as I have seen it done by [edgeimpulse.com](https://edgeimpulse.com/) .  If you have any links that would be useful.

**What I am trying to do is to simplify  the full pipeline for making machine learning models for microcontrollers like Arduinos using client side browser javascript** 

I have already done it using webSerial, an example static webpage is [here](https://hpssjellis.github.io/tinyMLjs/public/acceleration/a00-best-acceleration-nicla.html)   to make a tensorflowJS model. Then a [gitpod](https://github.com/hpssjellis/tensorflowjs-to-arduino-for-tinymljs)  (if you have a gitpod account just click [here](https://gitpod.io/#github.com/hpssjellis/tensorflowjs-to-arduino-for-tinymljs)   ) to convert that model to a tFlite c-header file and then an old [my Tensorflow library](https://github.com/hpssjellis/RocksettaTinyML) I made 3 years ago to help get the Arduino code working.


The above process works except there are two main things I wish to improve:

1. simplify the conversion without the user having to load a complete python environment. (This might be much easier using ipython notebooks, it still uses python not javascript but at least it would be simple.)
2. Update my [my Tensorflow Library](https://github.com/hpssjellis/RocksettaTinyML) .   This will be a fair bit harder and I might need some help.



     
 Hi @hpssjellis 

The TFLite converter basically converts the TF/Keras/JAX models to `.tflite` which can be done in either ways, through python API or we can use command line tool to directly convert into `.tflite` without using any python code.

https://www.tensorflow.org/lite/models/convert/convert_models#command_line_tool_

The then `.tflite` can be used by TFJS TFLite API which is packaged in a WebAssembly binary that runs in a browser.

https://js.tensorflow.org/api_tflite/0.0.1-alpha.4

Does that help your use case?

Thanks. This issue is stale because it has been open for 7 days with no activity. It will be closed if no further activity occurs. Thank you. This issue was closed because it has been inactive for 7 days since being marked as stale. Please reopen if you'd like to work on this further. Are you satisfied with the resolution of your issue?
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=Yes&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62324">Yes</a>
<a href="https://docs.google.com/forms/d/e/1FAIpQLSfaP12TRhd9xSxjXZjcZFNXPGk4kc1-qMdv3gc6bEP90vY1ew/viewform?entry.85265664=No&entry.2137816233=https://github.com/tensorflow/tensorflow/issues/62324">No</a>

Does anyone know if [TensorFlowLite_converter](tensorflow/lite/python/lite.py) and [TensorflowJS converters](https://github.com/tensorflow/tfjs/tree/master/tfjs-converter/python/tensorflowjs/converters) can be converted into C/C++ code from Python?

My end goal is to then use [emscripten.org](https://emscripten.org/)  to convert both of them into WASM and try to run them from a browser javascript webpage.

I am only interested in simple ML such as a 3  dense layer model etc.